Add cropping

This commit is contained in:
Sophie Herold 2024-09-15 21:06:23 +02:00
parent 4c2b72e0f9
commit 6867e0b13f
19 changed files with 1414 additions and 52 deletions

View file

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