summaryrefslogtreecommitdiff
path: root/gtk/gtkcssimagebuiltin.c
diff options
context:
space:
mode:
authorSebastian Keller <sebastian-keller@gmx.de>2015-01-21 01:14:55 +0100
committerBenjamin Otte <otte@redhat.com>2015-01-21 01:38:51 +0100
commit8836a0d6ce554164e4f513bbf0c0743f629af8e0 (patch)
treee9c72a222ed3c2b95cd14d71c57336b4442ba698 /gtk/gtkcssimagebuiltin.c
parentda163469f9d344190f69bfc163517154af0e2dab (diff)
downloadgtk+-8836a0d6ce554164e4f513bbf0c0743f629af8e0.tar.gz
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.
Diffstat (limited to 'gtk/gtkcssimagebuiltin.c')
-rw-r--r--gtk/gtkcssimagebuiltin.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gtk/gtkcssimagebuiltin.c b/gtk/gtkcssimagebuiltin.c
index d3644962b9..3ee9bd5c96 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);