mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 06:10:15 +00:00
range: Don't invalidate layout when computing marks
We now have a function to compute a slider position. Use that one instead.
This commit is contained in:
parent
b88584e7ba
commit
06150aa517
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user