I have an NSSplitView in my app that has 3 panes. I've subclassed NSSplitView and it has a single override:
-(CGFloat) dividerThickness { return 1.0f; }
I have disabled ALL the delegate methods that constrain divider min/max points and resize subviews, etc.
When I drag any divider on a retina screen, the divider's thickness fluctuates during the drag. See this video: http://incident57.com/divider.mp4
This happens no matter what divider thickness I use---the thickness always varies by about 1px during drag.
This DOES NOT HAPPEN on non-retina screens. It also DOES NOT HAPPEN when the window itself is resized. The divider width only fluctuates when the divider itself is dragged.
(If you look really closely, you can see that there's some blank, white space between the views where it looks like NSSplitView should be drawing the divider, but isn't. Look at the end of the brown selected table row in the video.)
How do I fix this so that the divider width stays constant during drags on retina screens?
I solved this problem by implementing this NSSplitViewDelegate method:
- (CGFloat) splitView:(NSSplitView *)splitView constrainSplitPosition:(CGFloat)proposedPosition ofSubviewAt:(NSInteger)dividerIndex
{
return floor(proposedPosition);
}
It's also worth pointing out that this issue only manifests if the subviews within the panes of the NSSplitView are NSScrollViews. Normal NSViews inside the panes will not cause the divider-width fluctuation.