From 06150aa51737751f0beff31eb446bb2a00b2b06e Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 21 Nov 2014 08:29:37 +0100 Subject: [PATCH] range: Don't invalidate layout when computing marks We now have a function to compute a slider position. Use that one instead. --- gtk/gtkrange.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c index ae61727121..80e632a38d 100644 --- a/gtk/gtkrange.c +++ b/gtk/gtkrange.c @@ -3963,6 +3963,7 @@ static void gtk_range_calc_marks (GtkRange *range) { GtkRangePrivate *priv = range->priv; + GdkRectangle slider; gint i; if (!priv->recalc_marks) @@ -3972,15 +3973,13 @@ gtk_range_calc_marks (GtkRange *range) for (i = 0; i < priv->n_marks; i++) { - priv->need_recalc = TRUE; - gtk_range_calc_layout (range, priv->marks[i]); - if (priv->orientation == GTK_ORIENTATION_HORIZONTAL) - priv->mark_pos[i] = priv->slider.x + priv->slider.width / 2; - else - priv->mark_pos[i] = priv->slider.y + priv->slider.height / 2; - } + gtk_range_compute_slider_position (range, priv->marks[i], &slider); - priv->need_recalc = TRUE; + if (priv->orientation == GTK_ORIENTATION_HORIZONTAL) + priv->mark_pos[i] = slider.x + slider.width / 2; + else + priv->mark_pos[i] = slider.y + slider.height / 2; + } } static gboolean