1
Author: Goedson Teixeira Paixao <goedson@debian.org>
2
Description: Fixes rotation operations
3
Implement the rotation in multiples of 90 degrees using the
4
gdk_pixbuf_rotate_simple function instead of the custom (and broken)
6
Bug-Debian: http://bugs.debian.org/497487
7
Bug-Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/gpaint/+bug/262942
8
Forwarded: https://savannah.gnu.org/patch/?6643
10
Index: b/src/drawing.c
11
===================================================================
12
--- a/src/drawing.c 2009-12-19 17:12:10.000000000 -0200
13
+++ b/src/drawing.c 2009-12-19 17:12:11.000000000 -0200
18
-drawing_rotate(gpaint_drawing *drawing, double degrees)
19
+drawing_rotate(gpaint_drawing *drawing, int degrees)
21
gpaint_image *image = drawing_create_image(drawing);
24
- image_rotate(image, degrees);
31
+ image_rotate_simple(image, degrees);
34
+ image_rotate(image, degrees);
38
/* copy rotated image on the pixmap */
39
gdk_pixmap_unref(drawing->backing_pixmap);
40
Index: b/src/drawing.h
41
===================================================================
42
--- a/src/drawing.h 2009-12-19 17:11:48.000000000 -0200
43
+++ b/src/drawing.h 2009-12-19 17:12:11.000000000 -0200
45
void drawing_clear(gpaint_drawing *drawing);
46
void drawing_clear_selection(gpaint_drawing *drawing, gpaint_point_array *points);
47
gboolean drawing_prompt_to_save(gpaint_drawing *drawing);
48
-void drawing_rotate(gpaint_drawing *drawing, double degrees);
49
+void drawing_rotate(gpaint_drawing *drawing, int degrees);
53
===================================================================
54
--- a/src/image.c 2009-12-19 17:11:48.000000000 -0200
55
+++ b/src/image.c 2009-12-19 17:12:11.000000000 -0200
61
+image_rotate_simple (gpaint_image *image, int degrees)
63
+ GdkPixbuf *newpixbuf;
67
+ case GDK_PIXBUF_ROTATE_NONE:
68
+ case GDK_PIXBUF_ROTATE_COUNTERCLOCKWISE:
69
+ case GDK_PIXBUF_ROTATE_UPSIDEDOWN:
70
+ case GDK_PIXBUF_ROTATE_CLOCKWISE:
71
+ newpixbuf = gdk_pixbuf_rotate_simple (image->pixbuf, degrees);
72
+ gdk_pixbuf_unref (image->pixbuf);
73
+ image->pixbuf = newpixbuf;
82
GdkPixbuf* image_pixbuf(gpaint_image* image) {
85
===================================================================
86
--- a/src/image.h 2009-12-19 17:11:48.000000000 -0200
87
+++ b/src/image.h 2009-12-19 17:12:11.000000000 -0200
89
int image_flip_x(gpaint_image *image);
90
int image_flip_y(gpaint_image *image);
91
int image_rotate(gpaint_image *image, double radians);
92
+int image_rotate_simple(gpaint_image *image, int degrees);
93
GdkPixbuf* image_pixbuf(gpaint_image *image);
96
===================================================================
97
--- a/src/menu.c 2009-12-19 17:12:10.000000000 -0200
98
+++ b/src/menu.c 2009-12-19 17:12:11.000000000 -0200
101
sscanf(name, "rotate_%c%d_menu", &sign, °rees);
102
debug2("sign = %c degrees = %d", sign, degrees);
107
+ degrees = 360 - degrees;
109
canvas_focus_lost(canvas);
110
drawing_rotate(canvas->drawing, degrees);