TUIViewNSViewContainers aren't affected by transforms #38

Open
jwilling opened this Issue Jul 28, 2012 · 9 comments

Comments

Projects
None yet
3 participants

When you have a TUIView with a TUIViewNSViewContainer added to it, transforms and animations applied to the TUIView's layer aren't applied to the TUIViewNSViewContainer. This might be impossible to fix.

There's code in there to handle animations, and convertRect:toLayer: is used for geometry, which should take transforms into account. Can you provide more information or some sample code?

After thinking about this some more, you're definitely right that an NSView won't appear transformed (though its coordinates should be correct). It is possible to fix, but the consequence might be loss of interactivity in the view.

Still, animations should work.

Odd. Do animations only work when using TUIView's block animation methods? Because when I use Core Animation to directly affect the layer's transform of a TUIView, a NSView contained inside it was not affected by the applied transform.

After investigating:

  1. Animations do indeed only work when using TUIView animation methods. Animations added to the layer hierarchy currently do not animate NSViews alongside. Arguably, this sort of limitation is exactly what the TUIViewNSViewContainer documentation refers to (though I would still like to fix it).
  2. Animating TUIView.transform will correctly animate hosted NSViews.
  3. Hosted NSViews currently do not support sitting in a transformed state.

See my changes to the example app on the nsview-transform-support branch.

Thank you for looking into this. I had already reworked my hierarchy to work around this issue, and therefore hadn't looked into the header comments as much as I should have.

choco commented Aug 1, 2012

I'm not sure if it's related to this but I was just messing around with the example app and got the following behaviour
http://cl.ly/ITZm Just make an NSTextField as first responder and if you scroll it will still show over other TUIView (i.e. Tabbar)

@choco Definitely unrelated. Did you turn off ENABLE_NSVIEW_CLIPPING, by chance?

choco commented Aug 1, 2012

No it's enabled, I just cloned the repository, compiled the example app and noticed this.

@choco Opened #41 to track that. Thanks for the heads-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment