[gthumb] rotate tool: fixed crop region when the angle is greater than 90
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] rotate tool: fixed crop region when the angle is greater than 90
- Date: Wed, 15 Aug 2012 14:16:57 +0000 (UTC)
commit 938c00503108ce49a70719e7c8f1dd89eeb1cf75
Author: Paolo Bacchilega <paobac src gnome org>
Date: Wed Aug 15 16:03:43 2012 +0200
rotate tool: fixed crop region when the angle is greater than 90
extensions/file_tools/cairo-rotate.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/extensions/file_tools/cairo-rotate.c b/extensions/file_tools/cairo-rotate.c
index 5830e4b..706571e 100644
--- a/extensions/file_tools/cairo-rotate.c
+++ b/extensions/file_tools/cairo-rotate.c
@@ -35,7 +35,10 @@ _cairo_image_surface_rotate_get_cropping_parameters (cairo_surface_t *image,
double src_width, src_height;
double t1, t2;
- angle = CLAMP (angle, -90.0, 90.0);
+ if (angle < -90)
+ angle += 180;
+ else if (angle > 90)
+ angle -= 180;
angle_rad = fabs (angle) / 180.0 * G_PI;
@@ -77,7 +80,11 @@ _cairo_image_surface_rotate_get_cropping_region (cairo_surface_t *image,
double new_width;
double xx1, yy1, xx2, yy2;
- angle = CLAMP (angle, -90.0, 90.0);
+ if (angle < -90)
+ angle += 180;
+ else if (angle > 90)
+ angle -= 180;
+
p1 = CLAMP (p1, 0.0, 1.0);
p2 = CLAMP (p2, 0.0, 1.0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]