[dia] Fix bezier_render_(fill|stroke)
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] Fix bezier_render_(fill|stroke)
- Date: Fri, 13 Sep 2013 17:34:21 +0000 (UTC)
commit 7e221b2b286092e72c0181fef6c1d4674f1283a7
Author: Hans Breuer <hans breuer org>
Date: Fri Sep 13 18:58:52 2013 +0200
Fix bezier_render_(fill|stroke)
The previous version did not correctly draw the remaining parts
after the main loop. The bug stayed unnoticed with the complex
curves for "Standard - Outline", but became very visible with
the path-variations.svg with it simple holes being blanked.
lib/diarenderer.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/lib/diarenderer.c b/lib/diarenderer.c
index 20767bc..1be6227 100644
--- a/lib/diarenderer.c
+++ b/lib/diarenderer.c
@@ -1579,13 +1579,13 @@ bezier_render_fill (DiaRenderer *renderer, BezPoint *pts, int total, Color *colo
}
}
}
- /* the last one is not drawn yet */
+ /* the last one is not drawn yet, i is pointing to the last element */
if (s2 > s1) { /* blanking the previous one */
- if (s2 - i - 1 > 1) /* depending on the above we may be ready */
- DIA_RENDERER_GET_CLASS (renderer)->fill_bezier (renderer, &pts[s2], s2 - i - 1, &color_white);
+ if (i - s2 - 1 > 1) /* depending on the above we may be ready */
+ DIA_RENDERER_GET_CLASS (renderer)->fill_bezier (renderer, &pts[s2], i - s2, &color_white);
} else {
- if (s1 - i - 1 > 1)
- DIA_RENDERER_GET_CLASS (renderer)->fill_bezier (renderer, &pts[s1], s1 - i - 1, color);
+ if (i - s1 - 1 > 1)
+ DIA_RENDERER_GET_CLASS (renderer)->fill_bezier (renderer, &pts[s1], i - s1, color);
}
}
@@ -1604,6 +1604,6 @@ bezier_render_stroke (DiaRenderer *renderer, BezPoint *pts, int total, Color *co
}
}
/* the last one, if there is one */
- if (i - n - 1 > 0)
- DIA_RENDERER_GET_CLASS (renderer)->draw_bezier (renderer, &pts[n], i - n - 1, color);
+ if (i - n > 1)
+ DIA_RENDERER_GET_CLASS (renderer)->draw_bezier (renderer, &pts[n], i - n, color);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]