[gtk+] stylecontext: Use old rounding for get_padding/border/margin()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] stylecontext: Use old rounding for get_padding/border/margin()
- Date: Sat, 31 Jan 2015 01:26:41 +0000 (UTC)
commit bece876f8eded4a5deee5db9b96ef52a5a61ef0a
Author: Benjamin Otte <otte redhat com>
Date: Sat Jan 31 02:25:18 2015 +0100
stylecontext: Use old rounding for get_padding/border/margin()
610f7e8f70ce165e04a4cdc3fd20b560f500b925 changed the way we query those
values for performance reasons but didn't copy the rounding used.
Fixes border-half-pixel reftest.
gtk/gtkstylecontext.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 13d9375..c3e70f7 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3296,10 +3296,10 @@ gtk_style_context_get_border (GtkStyleContext *context,
style = gtk_style_context_lookup_style_for_state (context, state);
- top = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100);
- right = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH),
100);
- bottom = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH),
100);
- left = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH),
100);
+ top = round (_gtk_css_number_value_get (gtk_css_style_get_value (style,
GTK_CSS_PROPERTY_BORDER_TOP_WIDTH), 100));
+ right = round (_gtk_css_number_value_get (gtk_css_style_get_value (style,
GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH), 100));
+ bottom = round (_gtk_css_number_value_get (gtk_css_style_get_value (style,
GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH), 100));
+ left = round (_gtk_css_number_value_get (gtk_css_style_get_value (style,
GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH), 100));
border->top = top;
border->left = left;
@@ -3333,10 +3333,10 @@ gtk_style_context_get_padding (GtkStyleContext *context,
style = gtk_style_context_lookup_style_for_state (context, state);
- top = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_PADDING_TOP), 100);
- right = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_PADDING_RIGHT), 100);
- bottom = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_PADDING_BOTTOM), 100);
- left = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_PADDING_LEFT), 100);
+ top = round (_gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_PADDING_TOP),
100));
+ right = round (_gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_PADDING_RIGHT),
100));
+ bottom = round (_gtk_css_number_value_get (gtk_css_style_get_value (style,
GTK_CSS_PROPERTY_PADDING_BOTTOM), 100));
+ left = round (_gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_PADDING_LEFT),
100));
padding->top = top;
padding->left = left;
@@ -3370,10 +3370,10 @@ gtk_style_context_get_margin (GtkStyleContext *context,
style = gtk_style_context_lookup_style_for_state (context, state);
- top = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MARGIN_TOP), 100);
- right = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MARGIN_RIGHT), 100);
- bottom = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MARGIN_BOTTOM), 100);
- left = _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MARGIN_LEFT), 100);
+ top = round (_gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MARGIN_TOP),
100));
+ right = round (_gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MARGIN_RIGHT),
100));
+ bottom = round (_gtk_css_number_value_get (gtk_css_style_get_value (style,
GTK_CSS_PROPERTY_MARGIN_BOTTOM), 100));
+ left = round (_gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MARGIN_LEFT),
100));
margin->top = top;
margin->left = left;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]