Commit e6798eca authored by Debarshi Ray's avatar Debarshi Ray

base-item, gegl-gtk-view-helper: Simplify code

parent 57e00690
......@@ -140,7 +140,7 @@ update_autoscale(ViewHelper *self)
if (bbox.width > real_viewport_width || bbox.height > real_viewport_height) {
float width_ratio = bbox.width / (float)real_viewport_width;
float height_ratio = bbox.height / (float)real_viewport_height;
float max_ratio = width_ratio >= height_ratio ? width_ratio : height_ratio;
float max_ratio = MAX (height_ratio, width_ratio);
zoom_scaled = 1.0 / max_ratio;
......
......@@ -1487,7 +1487,7 @@ photos_base_item_create_preview (PhotosBaseItem *self,
buffer = gegl_buffer_dup (buffer_orig);
bbox = *gegl_buffer_get_extent (buffer);
min_dimension = bbox.height < bbox.width ? bbox.height : bbox.width;
min_dimension = MIN (bbox.height, bbox.width);
x = (gdouble) (bbox.width - min_dimension) / 2.0;
y = (gdouble) (bbox.height - min_dimension) / 2.0;
size_scaled = size * scale;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment