[Drawkit] Fix for DKArcPath and margin changes
Graham Cox
graham.cox at bigpond.com
Thu Oct 2 19:48:24 PDT 2008
On 3 Oct 2008, at 6:13 am, Brad Larson wrote:
> Currently, DKArcPath elements don't respond to changes in the margin
> size, if that change results in a shift of the drawing origin. To
> fix this, you can add the following to DKArcPath.m:
>
> - (void) applyTransform:(NSAffineTransform*) transform
> {
> [self notifyVisualChange];
> [[self path] transformUsingAffineTransform:transform];
> mCentre = [transform transformPoint:mCentre];
> [self notifyVisualChange];
> }
>
> This makes sure that the center point of the arc is translated
> properly.
Hi Brad,
Thanks for that and the other suggestion regarding circles. I've added
both to the base code.
Note that the above I've actually implemented as:
- (void) applyTransform:(NSAffineTransform*) transform
{
[super applyTransform:transform];
mCentre = [transform transformPoint:mCentre];
}
Since DKDrawablePath is already handling most of it, and if that were
ever to change, this would get the benefit automatically. The same
thing needs to be added to DKRegularPolygonPath also.
cheers, Graham
More information about the Drawkit
mailing list