diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2016-12-27 16:18:47 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2016-12-27 16:18:47 +0000 |
| commit | 7b0c6be2e9f989023ceaab6caa59b7abd2e2a6b1 (patch) | |
| tree | 35fce8d419990dd49f5bc5df4e105303ab38b18e /src/widgets/gimp/ruler.cpp | |
| parent | Rm remaining Gtk::Stock usage (diff) | |
| download | inkscape-7b0c6be2e9f989023ceaab6caa59b7abd2e2a6b1.tar.gz inkscape-7b0c6be2e9f989023ceaab6caa59b7abd2e2a6b1.zip | |
Merge all upstream changes to GimpRuler
(bzr r15369)
Diffstat (limited to 'src/widgets/gimp/ruler.cpp')
| -rw-r--r-- | src/widgets/gimp/ruler.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/widgets/gimp/ruler.cpp b/src/widgets/gimp/ruler.cpp index bfb9c9071..7e9547080 100644 --- a/src/widgets/gimp/ruler.cpp +++ b/src/widgets/gimp/ruler.cpp @@ -548,7 +548,7 @@ sp_ruler_size_allocate (GtkWidget *widget, resized = (widget_allocation.width != allocation->width || widget_allocation.height != allocation->height); - gtk_widget_set_allocation(widget, allocation); + GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation); if (gtk_widget_get_realized (widget)) { @@ -725,7 +725,17 @@ sp_ruler_draw_pos (SPRuler *ruler, cairo_fill (cr); } - priv->last_pos_rect = pos_rect; + if (priv->last_pos_rect.width != 0 && + priv->last_pos_rect.height != 0) + { + gdk_rectangle_union (&priv->last_pos_rect, + &pos_rect, + &priv->last_pos_rect); + } + else + { + priv->last_pos_rect = pos_rect; + } } /** @@ -999,6 +1009,12 @@ sp_ruler_set_position (SPRuler *ruler, (ABS (xdiff) > IMMEDIATE_REDRAW_THRESHOLD || ABS (ydiff) > IMMEDIATE_REDRAW_THRESHOLD)) { + if (priv->pos_redraw_idle_id) + { + g_source_remove (priv->pos_redraw_idle_id); + priv->pos_redraw_idle_id = 0; + } + sp_ruler_queue_pos_redraw (ruler); } else if (! priv->pos_redraw_idle_id) @@ -1351,15 +1367,16 @@ sp_ruler_queue_pos_redraw (SPRuler *ruler) gtk_widget_get_allocation (GTK_WIDGET(ruler), &allocation); - gtk_widget_queue_draw_area (GTK_WIDGET(ruler), + gtk_widget_queue_draw_area (GTK_WIDGET (ruler), rect.x + allocation.x, rect.y + allocation.y, rect.width, rect.height); - if (priv->last_pos_rect.width != 0 || priv->last_pos_rect.height != 0) + if (priv->last_pos_rect.width != 0 && + priv->last_pos_rect.height != 0) { - gtk_widget_queue_draw_area (GTK_WIDGET(ruler), + gtk_widget_queue_draw_area (GTK_WIDGET (ruler), priv->last_pos_rect.x + allocation.x, priv->last_pos_rect.y + allocation.y, priv->last_pos_rect.width, |
