> On Sep 21, 2013, at 1:38 PM, Markus Spoettl <[email protected]> wrote:
> 
> Hi,
> 
>  I have a UIView on iOS that shares (a lot of) code with an NSView I have on 
> OSX. That code relies on a LLO (lower left origin) coordinate system and it's 
> not an option to change that.

You’re not gonna like where this conversation is going.

> So I transform the coordinate system of the view by setting
> 
> [self setTransform:CGAffineTransformMakeScale(1, -1)];
> 
> in the UIView variant's -initializer. That works well, it effects all areas 
> of view code the right way, including drawing and touch-events. Just what I 
> want. Or so it seems.
> 
> Something must be wrong, because in some situations, when I animate the 
> view's frame (using UIView's -animateWithDuration::: methods), the system 
> seems to have trouble handling this view properly.

This is because the frame of a view is meaningless once you've applied a 
transform.

Unlike the Mac, on iOS the frame and bounds do not define two separate 
coordinate systems. A UIView's size in its superview’s coordinate space is 
defined by its bounds.width. So flippedness doesn't really make sense on iOS.

> So, it's the transform. Can I do something about that?

You can fix your code to be origin-agnostic.

--Kyle Sluder

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to