NSTextField Redrawing of Background With Layer-Backing
||Date Originated:||Jan 14, 2013|
|Product:||Mac OS X
When used as subview of a view that has layer-backing turned on then making it wider causes the background color to not fill the entire area of the control.
I am seeing this bug in a scenario where I have a text field in an inspector panel that I can change in width via an NSSplitView. I attached a screen shot of the bug how it appears on an empty text field without the workaround mentioned below.
Steps to Reproduce:
- have an NSView that has layer-backing turned on
- add an NSTextField as a subview to that
- have layout constraints that fix the left and right margin between the text field and the superview
- enlarge the NSView
- the background color of the control should be filled consistently
- the amount of text in the textfield seems to play a role. If it is empty then the unfilled background stays. If not then it might get filled once the user release the mouse button
- only the part of the control that was visible before stays filled, the new space appearing on the right side does not have background filling
- only occurs in connection with layers.
As workaround I subclassed NSTextField and overwrite drawRect like this:
This fixes the problem because the dirtyRect is too small.
Reports posted here will not necessarily be seen by Apple.
All problems should be submitted at bugreport.apple.com before they are posted here.
Please only post information for Radars that you have filed yourself, and please do
not include Apple confidential information in your posts. Thank you!