Skip to content

Commit

Permalink
redraw boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
bertiqwerty committed May 25, 2024
1 parent 74caf84 commit 0c25ba8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rvimage/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ struct RvImageApp {
t_last_iterations: [f64; 3],
egui_perm_shapes: Vec<Shape>,
egui_tmp_shapes: [Option<Shape>; 2],
prev_im_rect: Option<Rect>,
}

impl RvImageApp {
Expand Down Expand Up @@ -647,6 +648,11 @@ impl eframe::App for RvImageApp {
let image_response = self.add_image(ui);
let mut update_texture = false;
if let Some(ir) = image_response {
// react to resizing the image rect
if self.prev_im_rect != Some(ir.rect) {
self.update_perm_annos(&ir.rect);
self.prev_im_rect = Some(ir.rect);
}
self.events = self.collect_events(ui, &ir);
if let UpdatePermAnnos::Yes(perm_annos) = update_view.perm_annos {
self.annos = perm_annos;
Expand Down

0 comments on commit 0c25ba8

Please sign in to comment.