summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-05-05 15:17:56 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-05-05 15:19:15 -0400
commit162e41633d8489ab9b43da3fca53425aa5af1330 (patch)
tree9e5cd8e623db33291c9c9d8c96d455df9a2ac54e
parent6f2187270e914f3da018e1bcc4278c0c2c9eb042 (diff)
downloadgtk+-162e41633d8489ab9b43da3fca53425aa5af1330.tar.gz
scale: Fix mark positioning at the left/top edge
We were failing to take the widget allocation.x/y into account when deciding whether we need to push in the mark. https://bugzilla.gnome.org/show_bug.cgi?id=765922
-rw-r--r--gtk/gtkscale.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index a9a6fe2799..8b22cc0bd5 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -480,9 +480,13 @@ gtk_scale_allocate_marks (GtkCssGadget *gadget,
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (scale));
_gtk_range_get_stop_positions (GTK_RANGE (scale), &marks);
- min_pos_before = min_pos_after = 0;
gtk_widget_get_allocation (widget, &widget_alloc);
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ min_pos_before = min_pos_after = widget_alloc.x;
+ else
+ min_pos_before = min_pos_after = widget_alloc.y;
+
for (m = priv->marks, i = 0; m; m = m->next, i++)
{
GtkScaleMark *mark = m->data;