edit: Scale cropping selection area with image

This commit is contained in:
Sophie Herold 2024-09-17 20:13:39 +02:00
parent 6867e0b13f
commit 5b184e6be9
8 changed files with 133 additions and 56 deletions

View file

@ -104,15 +104,16 @@ impl imp::LpImage {
}
fn horizontal_bar(&self) -> f64 {
let obj = self.obj();
f64::max(0., (self.widget_width() - obj.image_displayed_width()) / 2.)
f64::max(
0.,
(self.widget_width() - self.image_displayed_width()) / 2.,
)
}
fn vertical_bar(&self) -> f64 {
let obj = self.obj();
f64::max(
0.,
(self.widget_height() - obj.image_displayed_height()) / 2.,
(self.widget_height() - self.image_displayed_height()) / 2.,
)
}