From 9606633d947b918815293cf9885c1592b77bdecc Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 8 Jun 2011 07:04:38 +0200 Subject: [PATCH] border-image-repeat: Fix order of hrepeat and vrepeat --- gtk/gtkborderimage.c | 16 ++++++++-------- gtk/gtkstyleproperty.c | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gtk/gtkborderimage.c b/gtk/gtkborderimage.c index bc9e3a6344..499bbe42d3 100644 --- a/gtk/gtkborderimage.c +++ b/gtk/gtkborderimage.c @@ -311,18 +311,18 @@ render_border (cairo_t *cr, target_x = border_area->left; target_y = (side == SIDE_TOP) ? 0 : (total_height - border_area->bottom); - if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_NONE) + if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_NONE) { target_width = image_area.width; } - else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_REPEAT) + else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_REPEAT) { repeat_pattern = TRUE; target_x = border_area->left + (total_width - border_area->left - border_area->right) / 2; target_y = ((side == SIDE_TOP) ? 0 : (total_height - border_area->bottom)) / 2; } - else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_ROUND) + else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_ROUND) { gint n_repeats; @@ -331,7 +331,7 @@ render_border (cairo_t *cr, n_repeats = (gint) floor (image_area.width / surface_width); target_width = image_area.width / n_repeats; } - else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_SPACE) + else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_SPACE) { cairo_surface_t *spaced_surface; @@ -356,11 +356,11 @@ render_border (cairo_t *cr, target_x = (side == SIDE_LEFT) ? 0 : (total_width - border_area->right); target_y = border_area->top; - if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_NONE) + if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_NONE) { target_height = total_height - border_area->top - border_area->bottom; } - else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_REPEAT) + else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_REPEAT) { repeat_pattern = TRUE; @@ -368,7 +368,7 @@ render_border (cairo_t *cr, target_x = (side == SIDE_LEFT) ? 0 : (total_width - border_area->right) / 2; target_y = border_area->top + (total_height - border_area->top - border_area->bottom) / 2; } - else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_ROUND) + else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_ROUND) { gint n_repeats; @@ -377,7 +377,7 @@ render_border (cairo_t *cr, n_repeats = (gint) floor (image_area.height / surface_height); target_height = image_area.height / n_repeats; } - else if (repeat->hrepeat == GTK_CSS_REPEAT_STYLE_SPACE) + else if (repeat->vrepeat == GTK_CSS_REPEAT_STYLE_SPACE) { cairo_surface_t *spaced_surface; diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c index 5e105a75a0..d707091725 100644 --- a/gtk/gtkstyleproperty.c +++ b/gtk/gtkstyleproperty.c @@ -976,8 +976,8 @@ border_image_repeat_value_parse (GtkCssParser *parser, styles[i] = styles[0]; } - image_repeat.vrepeat = styles[0]; - image_repeat.hrepeat = styles[1]; + image_repeat.hrepeat = styles[0]; + image_repeat.vrepeat = styles[1]; g_value_set_boxed (value, &image_repeat); @@ -1011,8 +1011,8 @@ border_image_repeat_value_print (const GValue *value, image_repeat = g_value_get_boxed (value); g_string_append_printf (string, "%s %s", - border_image_repeat_style_to_string (image_repeat->vrepeat), - border_image_repeat_style_to_string (image_repeat->hrepeat)); + border_image_repeat_style_to_string (image_repeat->hrepeat), + border_image_repeat_style_to_string (image_repeat->vrepeat)); } static gboolean