From 1c46dd6417a55c9375d1693d111688c6a4721a33 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sun, 20 Dec 2009 18:47:26 +0000 Subject: [PATCH] Cairo backend: -DPSsetflat: and -DPScurrentflat should not have been transforming the flatness value with the current transformation matrix. The effect of this could be seen in the Apple BezierPathLab example; zooming in on the circle caused it to look more and more like a polygon. Also set NSBezierPath default flatness to 0.6 to match OS X (it was 1.0, which made circles look a bit rough) git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@29145 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 +++++++++ Source/cairo/CairoGState.m | 7 ++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99947e1..e07dd03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-12-19 Eric Wasylishen + + * Source/cairo/CairoGState.m: + -DPSsetflat: and -DPScurrentflat should not have been transforming + the flatness value with the current transformation matrix. + The effect of this could be seen in the Apple BezierPathLab example; + zooming in on the circle caused it to look more and more like a + polygon. + 2009-12-11 Eric Wasylishen * Source/cairo/CairoGState.m: diff --git a/Source/cairo/CairoGState.m b/Source/cairo/CairoGState.m index d4cb0da..a7ab31a 100644 --- a/Source/cairo/CairoGState.m +++ b/Source/cairo/CairoGState.m @@ -512,8 +512,7 @@ static float floatToUserSpace(NSAffineTransform *ctm, float f) { if (_ct) { - *flatness = (float)cairo_get_tolerance(_ct); - *flatness = floatToUserSpace(ctm, *flatness); + *flatness = (float)cairo_get_tolerance(_ct) * 2; } } @@ -621,7 +620,9 @@ static float floatToUserSpace(NSAffineTransform *ctm, float f) [super DPSsetflat: flatness]; if (_ct) { - cairo_set_tolerance(_ct, floatFromUserSpace(ctm, flatness)); + // Divide GNUstep flatness by 2 to get Cairo tolerance - this produces + // results visually similar to OS X. + cairo_set_tolerance(_ct, flatness / 2); } }