nsclipview

How do you get NSScrollView to center the document view in 10.9 and later?

[亡魂溺海] 提交于 2019-12-03 18:30:24
问题 There are lots of examples out there of how to get NSScrollView to center its document view. Here are two examples (which are so similar that somebody is copying somebody without attribution, but the point of how is there.) http://www.bergdesign.com/developer/index_files/88a764e343ce7190c4372d1425b3b6a3-0.html https://github.com/devosoft/avida/blob/master/apps/viewer-macos/src/main/CenteringClipView.h This is normally done by subclassing NSClipView and overriding: - (NSPoint