Skip to content

area of egui::Resize() ? #969

Answered by strasdat
strasdat asked this question in Q&A
Dec 18, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Okay, using ui.painter() seems to work:

 let mut response: Option<egui::Response> = None;
        let res = egui::Window::new(label).show(egui_ctx, |ui| {
            egui::Resize::default()
                .default_size([150.0, 200.0])
                .show(ui, |ui| {
                        println!(
                            "img {} {}",
                            ui.painter().clip_rect().width(),
                            ui.painter().clip_rect().height()
                        );

                        let image_response = ui.add(
                            egui::Image::new(
                                texture_id,
                                egui::Vec2::new(
        …

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@strasdat
Comment options

@strasdat
Comment options

Answer selected by strasdat
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants