From a8ca9fabfa069058e3244c1d88ad6d5e7314fadb Mon Sep 17 00:00:00 2001 From: raster Date: Thu, 23 Feb 2012 06:07:37 +0000 Subject: [PATCH] fix update region handling with scaling. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@68303 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- ChangeLog | 4 ++++ src/lib/canvas/evas_object_image.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2cb509..8f789a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -667,3 +667,7 @@ For example, this can be used to nicely change the font and size in a text editor. +2012-02-23 Carsten Haitzler (The Rasterman) + + * Fix rouding of update regions for image objects when scaled + (leaves trails without this). diff --git a/src/lib/canvas/evas_object_image.c b/src/lib/canvas/evas_object_image.c index 2553ec4..4ebea08 100644 --- a/src/lib/canvas/evas_object_image.c +++ b/src/lib/canvas/evas_object_image.c @@ -3401,10 +3401,10 @@ evas_object_image_render_pre(Evas_Object *obj) y = idy; h = ((int)(idy + idh)) - y; - r.x = ((rr->x - 1) * w) / o->cur.image.w; - r.y = ((rr->y - 1) * h) / o->cur.image.h; - r.w = ((rr->w + 2) * w) / o->cur.image.w; - r.h = ((rr->h + 2) * h) / o->cur.image.h; + r.x = (rr->x * w) / o->cur.image.w; + r.y = (rr->y * h) / o->cur.image.h; + r.w = ((rr->w * w) + (o->cur.image.w * 2) - 1) / o->cur.image.w; + r.h = ((rr->h * h) + (o->cur.image.h * 2) - 1) / o->cur.image.h; r.x += obj->cur.geometry.x + x; r.y += obj->cur.geometry.y + y; RECTS_CLIP_TO_RECT(r.x, r.y, r.w, r.h, -- 2.7.4