gimp r25614 - in trunk: . app/widgets



Author: neo
Date: Sat May 10 11:58:25 2008
New Revision: 25614
URL: http://svn.gnome.org/viewvc/gimp?rev=25614&view=rev

Log:
2008-05-10  Sven Neumann  <sven gimp org>

	* app/widgets/gimpviewrenderer.c (gimp_view_renderer_real_draw):
	reset the translation on the cairo context. Resurrects brush
	emblems which were drawn in the wrong position.

	* app/widgets/gimpviewrendererbrush.c 
(gimp_view_renderer_brush_draw):
	formatting.



Modified:
   trunk/ChangeLog
   trunk/app/widgets/gimpviewrenderer.c
   trunk/app/widgets/gimpviewrendererbrush.c

Modified: trunk/app/widgets/gimpviewrenderer.c
==============================================================================
--- trunk/app/widgets/gimpviewrenderer.c	(original)
+++ trunk/app/widgets/gimpviewrenderer.c	Sat May 10 11:58:25 2008
@@ -713,13 +713,13 @@
     }
   else if (renderer->surface)
     {
-      cairo_content_t content = cairo_surface_get_content (renderer->surface);
-      gint            width   = renderer->width;
-      gint            height  = renderer->height;
-
-      cairo_translate (cr,
-                       area->x + (area->width  - width)  / 2,
-                       area->y + (area->height - height) / 2);
+      cairo_content_t content  = cairo_surface_get_content (renderer->surface);
+      gint            width    = renderer->width;
+      gint            height   = renderer->height;
+      gint            offset_x = area->x + (area->width  - width)  / 2;
+      gint            offset_y = area->y + (area->height - height) / 2;
+
+      cairo_translate (cr, offset_x, offset_y);
 
       cairo_rectangle (cr, 0, 0, width, height);
 
@@ -739,6 +739,8 @@
 
       cairo_set_source_surface (cr, renderer->surface, 0, 0);
       cairo_fill (cr);
+
+      cairo_translate (cr, - offset_x, - offset_y);
     }
 }
 

Modified: trunk/app/widgets/gimpviewrendererbrush.c
==============================================================================
--- trunk/app/widgets/gimpviewrendererbrush.c	(original)
+++ trunk/app/widgets/gimpviewrendererbrush.c	Sat May 10 11:58:25 2008
@@ -193,8 +193,8 @@
 #define INDICATOR_WIDTH  7
 #define INDICATOR_HEIGHT 7
 
-  if (renderer->width  >= INDICATOR_WIDTH  * 2 &&
-      renderer->height >= INDICATOR_HEIGHT * 2)
+  if (renderer->width  > 2 * INDICATOR_WIDTH &&
+      renderer->height > 2 * INDICATOR_HEIGHT)
     {
       gboolean  pipe      = GIMP_IS_BRUSH_PIPE (renderer->viewable);
       gboolean  generated = GIMP_IS_BRUSH_GENERATED (renderer->viewable);
@@ -218,7 +218,7 @@
 
       gimp_viewable_get_size (renderer->viewable, &brush_width, &brush_height);
 
-      if (renderer->width  < brush_width || renderer->height < brush_height)
+      if (renderer->width < brush_width || renderer->height < brush_height)
         {
           cairo_move_to (cr,
                          area->x + area->width  - INDICATOR_WIDTH + 1,



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