Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Issue #153 Wrong contentInsets when connected mouse #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

m1entus
Copy link

@m1entus m1entus commented Jan 12, 2016

No description provided.

@dani-mp
Copy link

dani-mp commented Jan 12, 2016

Hi, @m1entus. Thanks for the fix, you're awesome. I couldn't reproduce it in my Mac, but a colleague told me about it. It was happening after item selection, very weird.

Anyway, just setting the scroller type to .Overlay did the fix for me, without having to register for the notification.

@m1entus
Copy link
Author

m1entus commented Jan 12, 2016

Anyway this will resolve issue when scroller is set to Legacy, end if you connect/reconnect mouse again notification will be called and correct document size will be set ;)

- (void)preferredScrollerStyleDidChangeNotification:(NSNotification *)note {
NSView *documentView = self.documentView;

if (!CGSizeEqualToSize(NSSizeToCGSize(documentView.frame.size), NSSizeToCGSize(self.contentSize))) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this library is 64-bit only, there's no need to bridge between NSRect and CGRect. They can be used interchangeably. So it could just look like this:

if (!CGSizeEqualToSize(documentView.frame.size, self.contentSize)) {

@jwilling
Copy link
Owner

Thank you for spending the time to put this together. ✨

I just have a couple of comments and questions before I merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants