[gthumb] image viewer: allow to set the current surface again



commit bba79a65c7157f637893002c31d148b97b94575e
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Fri Jun 28 16:38:38 2013 +0200

    image viewer: allow to set the current surface again

 gthumb/gth-image-viewer.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gthumb/gth-image-viewer.c b/gthumb/gth-image-viewer.c
index f47b94d..6337ff5 100644
--- a/gthumb/gth-image-viewer.c
+++ b/gthumb/gth-image-viewer.c
@@ -1705,12 +1705,15 @@ _set_surface (GthImageViewer  *self,
              int              original_height,
              gboolean         better_quality)
 {
-       _cairo_clear_surface (&self->priv->surface);
+       if (self->priv->surface != surface) {
+               _cairo_clear_surface (&self->priv->surface);
+               self->priv->surface = cairo_surface_reference (surface);
+       }
+
        _cairo_clear_surface (&self->priv->iter_surface);
        _g_clear_object (&self->priv->animation);
        _g_clear_object (&self->priv->iter);
 
-       self->priv->surface = cairo_surface_reference (surface);
        self->priv->is_void = (self->priv->surface == NULL);
        self->priv->is_animation = FALSE;
        _gth_image_viewer_set_original_size (self, original_width, original_height);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]