From d6f343943b327ed1ce1ce4ebbbf160d8d87d1d1a Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sat, 2 Oct 2010 19:49:59 +0200 Subject: [PATCH] app: fix text cursor extents so it doesn't leave artifacts --- app/display/gimpcanvastextcursor.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/display/gimpcanvastextcursor.c b/app/display/gimpcanvastextcursor.c index e21a795ebf..c4ad313c3a 100644 --- a/app/display/gimpcanvastextcursor.c +++ b/app/display/gimpcanvastextcursor.c @@ -219,18 +219,18 @@ gimp_canvas_text_cursor_transform (GimpCanvasItem *item, *w -= *x; *h -= *y; - *x = PROJ_ROUND (*x) + 0.5; - *y = PROJ_ROUND (*y) + 0.5; + *x = floor (*x) + 0.5; + *y = floor (*y) + 0.5; if (private->overwrite) { - *w = PROJ_ROUND (*w) - 1.0; - *h = PROJ_ROUND (*h) - 1.0; + *w = ceil (*w) - 1.0; + *h = ceil (*h) - 1.0; } else { *w = 0; - *h = PROJ_ROUND (*h) - 1.0; + *h = ceil (*h) - 1.0; } } @@ -284,10 +284,10 @@ gimp_canvas_text_cursor_get_extents (GimpCanvasItem *item, } else { - rectangle.x = floor (x - 3.5); + rectangle.x = floor (x - 4.5); rectangle.y = floor (y - 1.5); - rectangle.width = ceil (8.0); - rectangle.height = ceil (h + 1.5); + rectangle.width = ceil (9.0); + rectangle.height = ceil (h + 3.0); } return gdk_region_rectangle (&rectangle);