Commit 6859c9f6 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

reset the translation on the cairo context. Resurrects brush emblems which

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.


svn path=/trunk/; revision=25614
parent e9625bc4
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.
2008-05-10 Michael Natterer <mitch@gimp.org> 2008-05-10 Michael Natterer <mitch@gimp.org>
* plug-ins/common/gtm.c: renamed... * plug-ins/common/gtm.c: renamed...
......
...@@ -713,13 +713,13 @@ gimp_view_renderer_real_draw (GimpViewRenderer *renderer, ...@@ -713,13 +713,13 @@ gimp_view_renderer_real_draw (GimpViewRenderer *renderer,
} }
else if (renderer->surface) else if (renderer->surface)
{ {
cairo_content_t content = cairo_surface_get_content (renderer->surface); cairo_content_t content = cairo_surface_get_content (renderer->surface);
gint width = renderer->width; gint width = renderer->width;
gint height = renderer->height; 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, cairo_translate (cr, offset_x, offset_y);
area->x + (area->width - width) / 2,
area->y + (area->height - height) / 2);
cairo_rectangle (cr, 0, 0, width, height); cairo_rectangle (cr, 0, 0, width, height);
...@@ -739,6 +739,8 @@ gimp_view_renderer_real_draw (GimpViewRenderer *renderer, ...@@ -739,6 +739,8 @@ gimp_view_renderer_real_draw (GimpViewRenderer *renderer,
cairo_set_source_surface (cr, renderer->surface, 0, 0); cairo_set_source_surface (cr, renderer->surface, 0, 0);
cairo_fill (cr); cairo_fill (cr);
cairo_translate (cr, - offset_x, - offset_y);
} }
} }
......
...@@ -193,8 +193,8 @@ gimp_view_renderer_brush_draw (GimpViewRenderer *renderer, ...@@ -193,8 +193,8 @@ gimp_view_renderer_brush_draw (GimpViewRenderer *renderer,
#define INDICATOR_WIDTH 7 #define INDICATOR_WIDTH 7
#define INDICATOR_HEIGHT 7 #define INDICATOR_HEIGHT 7
if (renderer->width >= INDICATOR_WIDTH * 2 && if (renderer->width > 2 * INDICATOR_WIDTH &&
renderer->height >= INDICATOR_HEIGHT * 2) renderer->height > 2 * INDICATOR_HEIGHT)
{ {
gboolean pipe = GIMP_IS_BRUSH_PIPE (renderer->viewable); gboolean pipe = GIMP_IS_BRUSH_PIPE (renderer->viewable);
gboolean generated = GIMP_IS_BRUSH_GENERATED (renderer->viewable); gboolean generated = GIMP_IS_BRUSH_GENERATED (renderer->viewable);
...@@ -218,7 +218,7 @@ gimp_view_renderer_brush_draw (GimpViewRenderer *renderer, ...@@ -218,7 +218,7 @@ gimp_view_renderer_brush_draw (GimpViewRenderer *renderer,
gimp_viewable_get_size (renderer->viewable, &brush_width, &brush_height); 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, cairo_move_to (cr,
area->x + area->width - INDICATOR_WIDTH + 1, area->x + area->width - INDICATOR_WIDTH + 1,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment