[dia] Bug #591911 - clipping problems when rendering with alpha
- From: Hans Breuer <hans src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [dia] Bug #591911 - clipping problems when rendering with alpha
- Date: Sun, 8 Nov 2009 14:30:50 +0000 (UTC)
commit cf021c3b0c722210f2096ac14433192959ff2aa7
Author: Hans Breuer <hans breuer org>
Date: Fri Aug 21 13:35:25 2009 +0200
Bug #591911 - clipping problems when rendering with alpha
The alpha rendering from bug #591525 made the lack of proper
clipping very visible, before the lack of it did not show because
drawing the same object multiple times had no accumulating effect.
plug-ins/cairo/diacairo-interactive.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/cairo/diacairo-interactive.c b/plug-ins/cairo/diacairo-interactive.c
index c83ab92..a9880a5 100644
--- a/plug-ins/cairo/diacairo-interactive.c
+++ b/plug-ins/cairo/diacairo-interactive.c
@@ -208,6 +208,11 @@ begin_render(DiaRenderer *self)
g_return_if_fail (base_renderer->cr == NULL);
base_renderer->cr = gdk_cairo_create(renderer->pixmap);
+ /* Setup clipping for this sequence of render operations */
+ /* Must be done before the scaling because the clip is in pixel coords */
+ gdk_cairo_region (base_renderer->cr, renderer->clip_region);
+ cairo_clip(base_renderer->cr);
+
cairo_scale (base_renderer->cr, *renderer->zoom_factor, *renderer->zoom_factor);
cairo_translate (base_renderer->cr, -renderer->visible->left, -renderer->visible->top);
@@ -359,6 +364,7 @@ static void
clip_region_clear(DiaRenderer *object)
{
DiaCairoInteractiveRenderer *renderer = DIA_CAIRO_INTERACTIVE_RENDERER (object);
+ DiaCairoRenderer *base_renderer = DIA_CAIRO_RENDERER (object);
if (renderer->clip_region != NULL)
gdk_region_destroy(renderer->clip_region);
@@ -373,6 +379,7 @@ clip_region_add_rect(DiaRenderer *object,
Rectangle *rect)
{
DiaCairoInteractiveRenderer *renderer = DIA_CAIRO_INTERACTIVE_RENDERER (object);
+ DiaCairoRenderer *base_renderer = DIA_CAIRO_RENDERER (object);
GdkRectangle clip_rect;
int x1,y1;
int x2,y2;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]