[gtk+] render: fix arrow orientation



commit 8836a0d6ce554164e4f513bbf0c0743f629af8e0
Author: Sebastian Keller <sebastian-keller gmx de>
Date:   Wed Jan 21 01:14:55 2015 +0100

    render: fix arrow orientation
    
    The rotation code in the draw_arrow function was assuming that the arrow
    would be drawn pointing upwards but it was pointing to the right
    resulting in the rotated arrows pointing in the wrong direction.
    
    The recent refactoring caused a pi/2 rotation to be lost. Rather than
    adding that back somehwere (to lose it again in the future), we just
    draw the arrow pointing upwards as it is expected to do with a 0 angle.

 gtk/gtkcssimagebuiltin.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcssimagebuiltin.c b/gtk/gtkcssimagebuiltin.c
index d364496..3ee9bd5 100644
--- a/gtk/gtkcssimagebuiltin.c
+++ b/gtk/gtkcssimagebuiltin.c
@@ -243,7 +243,6 @@ gtk_css_image_builtin_draw_arrow (GtkCssImage            *image,
       g_assert_not_reached ();
       break;
   }
-  cairo_translate (cr, size / 4.0, 0);
 
   line_width = size / 3.0 / sqrt (2);
   cairo_set_line_width (cr, line_width);
@@ -254,9 +253,9 @@ gtk_css_image_builtin_draw_arrow (GtkCssImage            *image,
                (size / (size + line_width)),
                (size / (size + line_width)));
 
-  cairo_move_to (cr, -size / 2.0, -size / 2.0);
+  cairo_move_to (cr, -size / 2.0, size / 4.0);
+  cairo_rel_line_to (cr, size / 2.0, -size / 2.0);
   cairo_rel_line_to (cr, size / 2.0, size / 2.0);
-  cairo_rel_line_to (cr, - size / 2.0, size / 2.0);
 
   gdk_cairo_set_source_rgba (cr, &builtin->fg_color);
   cairo_stroke (cr);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]