Subviews in flipped layer-backed views
Subviews in flipped layer-backed views
- Subject: Subviews in flipped layer-backed views
- From: Gordon Apple <email@hidden>
- Date: Sat, 27 Sep 2008 11:19:27 -0500
- Thread-topic: Subviews in flipped layer-backed views
This used to work in 10.5.4 not in 10.5.5. However, there have been
other changes in my code, so the cause could be elsewhere. I have a view
that is flipped. My draw objects can contain text which is flowed into the
shape of the object. The reason the view is flipped is that that is the
only way I have found works for text layout. For editing the text, I
install a NSTextView as a subview, a la the Sketch example. This works
great in a non-layer-backed view. It used to work properly in a
layer-backed view, but now it inverts both the text layout and the container
location when editing. So when I edit text in an object near the top of the
view, the edited textview text draws inverted near the bottom of the view.
Why? When editing is complete, the text draws correctly within the object.
BTW, just for experimentation, a button added to the view also draws its
text inverted when the view is layer-backed.
I need the same basic code to work in both layer-backed and
non-layer-backed views. In fact, I simultaneously display the same objects
in several different views. The only one I currently want layer-backed is
the main presentation view. After many weeks of haggling with layers to get
them to work properly in a scalable scrolling window, I now use an inverted
content layer that is a sublayer of the view¹s layer in order to get an
inverted coordinated system in the layer I draw into, so it will match what
is done in the non-layer-backed views.
I suppose that adding the NSTextView to a layer-backed view also makes
the textview layer-backed. However, this doesn¹t seem to explain anything.
Why is the textview (and controls) getting inverted just because its
superview is layer-backed? Shouldn¹t the subview get its coordinates from
the superview and not the superview¹s main layer?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden