[gnome-photos/wip/baedert/gtkimageview: 44/47] _
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/baedert/gtkimageview: 44/47] _
- Date: Fri, 15 Apr 2016 13:51:15 +0000 (UTC)
commit f50930a358a5afd33dfdc14350569512b9849ec9
Author: Timm Bäder <mail baedert org>
Date: Thu Apr 14 09:19:23 2016 +0200
_
src/photos-gegl-image.c | 36 ++++++++++++++++++------------------
1 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/src/photos-gegl-image.c b/src/photos-gegl-image.c
index a8d8473..1c38699 100644
--- a/src/photos-gegl-image.c
+++ b/src/photos-gegl-image.c
@@ -5,19 +5,19 @@
G_DEFINE_TYPE(PhotosGeglImage, photos_gegl_image, GTK_TYPE_ABSTRACT_IMAGE)
static int
-__get_width (GtkAbstractImage *_image)
+photos_gegl_image_get_width (GtkAbstractImage *_image)
{
return PHOTOS_GEGL_IMAGE (_image)->width;
}
static int
-__get_height (GtkAbstractImage *_image)
+photos_gegl_image_get_height (GtkAbstractImage *_image)
{
return PHOTOS_GEGL_IMAGE (_image)->height;
}
static int
-__get_scale_factor (GtkAbstractImage *_image)
+photos_gegl_image_get_scale_factor (GtkAbstractImage *_image)
{
return PHOTOS_GEGL_IMAGE (_image)->scale_factor;
}
@@ -51,7 +51,7 @@ photos_gegl_image_render_surface (PhotosGeglImage *image)
}
static void
-__draw (GtkAbstractImage *_image, cairo_t *ct)
+photos_gegl_image_draw (GtkAbstractImage *_image, cairo_t *ct)
{
PhotosGeglImage *image = PHOTOS_GEGL_IMAGE (_image);
@@ -78,24 +78,24 @@ photos_gegl_image_update_bbox (PhotosGeglImage *image)
g_message ("bbox: %d, %d, %d, %d", box.x, box.y, box.width, box.height);
#endif
- if (image->width != box.width || image->height != box.height ||
- image->roi.x != box.x || image->roi.y != box.y)
- {
- image->width = box.width;
+ /*if (image->width != box.width || image->height != box.height ||*/
+ /*image->roi.x != box.x || image->roi.y != box.y)*/
+ /*{*/
+ image->width = box.width;
image->height = box.height;
- image->roi.x = box.x;
- image->roi.y = box.y;
- image->roi.width = box.width * image->scale_factor;
- image->roi.height = box.height * image->scale_factor;
+ image->roi.x = box.x * image->view_scale;
+ image->roi.y = box.y * image->view_scale;
+ image->roi.width = box.width * image->scale_factor * image->view_scale;
+ image->roi.height = box.height * image->scale_factor * image->view_scale;
image->stride = cairo_format_stride_for_width (CAIRO_FORMAT_ARGB32, image->roi.width);
g_clear_pointer (&image->buf, g_free);
g_clear_pointer (&image->buf, cairo_surface_destroy);
- image->buf = g_malloc (image->stride * image->roi.height);
- }
+ image->buf = g_malloc (image->stride * image->roi.height * image->view_scale);
+ /*}*/
}
static void
@@ -151,10 +151,10 @@ photos_gegl_image_class_init (PhotosGeglImageClass *klass)
object_class->finalize = photos_gegl_image_finalize;
- image_class->draw = __draw;
- image_class->get_width = __get_width;
- image_class->get_height = __get_height;
- image_class->get_scale_factor = __get_scale_factor;
+ image_class->draw = photos_gegl_image_draw;
+ image_class->get_width = photos_gegl_image_get_width;
+ image_class->get_height = photos_gegl_image_get_height;
+ image_class->get_scale_factor = photos_gegl_image_get_scale_factor;
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]