Bug fixes:

1) awake all widgets after redraw of image after saving
2) Floting point issue in Crop position of new image
This commit is contained in:
Piyush मिश्रः 2022-02-04 12:57:00 +05:30
parent 50924e9354
commit 7aacea2310
2 changed files with 6 additions and 3 deletions

View File

@ -169,9 +169,10 @@ pub(crate) fn spawn_image_thread(
status.set_label("Saving...");
win.deactivate();
cont.save();
status.set_label("");
win.activate();
win.redraw();
status.set_label("");
app::awake();
}
}
DrawMessage::Clone => {
@ -194,6 +195,7 @@ pub(crate) fn spawn_image_thread(
status.set_label("");
win.activate();
win.redraw();
app::awake();
}
}
DrawMessage::Delete => {
@ -212,6 +214,7 @@ pub(crate) fn spawn_image_thread(
status.set_label("");
win.activate();
win.redraw();
app::awake();
}
}
}

View File

@ -121,8 +121,8 @@ impl ImageContainer {
let (origina_crop_width, origina_crop_height) =
croped_ratio(original_width, original_height);
prop.crop_position = Some((
original_width / 2.0 - origina_crop_width / 2.0,
original_height / 2.0 - origina_crop_height / 2.0,
(original_width - origina_crop_width) / 2.0,
(original_height - origina_crop_height) / 2.0,
));
let (s_width, s_height): (f64, f64) = Coord::from(self.image.dimensions()).into();