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
This commit is contained in:
Sven Neumann 2008-05-10 11:58:25 +00:00 committed by Sven Neumann
parent e9625bc485
commit 6859c9f642
3 changed files with 20 additions and 9 deletions

View File

@ -1,3 +1,12 @@
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>
* plug-ins/common/gtm.c: renamed...

View File

@ -713,13 +713,13 @@ gimp_view_renderer_real_draw (GimpViewRenderer *renderer,
}
else if (renderer->surface)
{
cairo_content_t content = cairo_surface_get_content (renderer->surface);
gint width = renderer->width;
gint height = renderer->height;
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,
area->x + (area->width - width) / 2,
area->y + (area->height - height) / 2);
cairo_translate (cr, offset_x, offset_y);
cairo_rectangle (cr, 0, 0, width, height);
@ -739,6 +739,8 @@ gimp_view_renderer_real_draw (GimpViewRenderer *renderer,
cairo_set_source_surface (cr, renderer->surface, 0, 0);
cairo_fill (cr);
cairo_translate (cr, - offset_x, - offset_y);
}
}

View File

@ -193,8 +193,8 @@ gimp_view_renderer_brush_draw (GimpViewRenderer *renderer,
#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_view_renderer_brush_draw (GimpViewRenderer *renderer,
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,