[gnome-photos] base-item, gegl-gtk-view-helper: Simplify code
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] base-item, gegl-gtk-view-helper: Simplify code
- Date: Wed, 30 Dec 2015 11:32:24 +0000 (UTC)
commit e6798eca44eec376b05ca95e3823ae22efdffbb7
Author: Debarshi Ray <debarshir gnome org>
Date: Sat Dec 26 22:49:01 2015 +0100
base-item, gegl-gtk-view-helper: Simplify code
src/gegl-gtk-view-helper.c | 2 +-
src/photos-base-item.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/gegl-gtk-view-helper.c b/src/gegl-gtk-view-helper.c
index cf82ec7..b837f21 100644
--- a/src/gegl-gtk-view-helper.c
+++ b/src/gegl-gtk-view-helper.c
@@ -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;
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 9ee8fef..d0ab398 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]