: Re: Problem with Grouping the rotated object
Let me explain how we are handling grouped objects.
We have only one basic type of draw object with a dictionary of
characteristics. That gives a lot of flexibility. We do not let objects
draw themselves. Instead, we use a separate rendering object
the group object has to compute it's own bounds, including internal
and total rotations. So far, this works quite well and we haven't
encountered the problem you have had.
> Message: 4
> Date: Wed, 2 Apr 2008 16:30:42 +0530
> From: "Ghufran Ahamad" <[EMAIL PROT
Quincey Morris wrote:
On Apr 2, 2008, at 04:00, Ghufran Ahamad wrote:
[xform translateXBy:center.x yBy:center.y];
[xform rotateByDegrees:[curGraphic GetAngle]];
[xform translateXBy:-center.x yBy:-center.y];
This looks kind of wrong. Mathematically, wouldn't you want:
[xform translate
On Apr 2, 2008, at 04:00, Ghufran Ahamad wrote:
NSAffineTransform* xform = [NSAffineTransform transform];
[currentContext saveGraphicsState];
[NSBezierPath clipRect:drawingBounds];
NSPoint center = NSMakePoint(NSMidX(stRect), NSMidY(stRect));
[xform translateXBy:center.x yBy:center.y];
[xf
That's not enough code to go on — it's not showing all the drawing.
Are you remembering to restore the saved graphics state after you
finish drawing an object?
Also, if you could paste in the code without the extra blank lines, it
would make it more readable.
—Jens
smime.p7s
Description:
Hi All,
We are developing a kind of drawing application in Objective C using Cocoa
framework. We have several separate graphical objects, each having their own
position and rotation angle, are then grouped. As soon as we group the
objects the rotated object has got shift with their angle. This