JNWCollectionView icon indicating copy to clipboard operation
JNWCollectionView copied to clipboard

Wrong contentInsets when connected mouse

Open m1entus opened this issue 9 years ago • 6 comments

If i connected mouse, then scrollView has wrong contentInset because of scroller, without mouse is fine. zrzut ekranu 2015-12-17 o 21 55 20

m1entus avatar Dec 17 '15 20:12 m1entus

Have you set content inset on the scroll view, or do you just mean the bounds are off? Unfortunately I don't have a mouse to test with at the moment. You might want to check what the bounds is that is being used to calculate the layout in the -layout method in JNWCollectionViewFramework.m.

jwilling avatar Dec 18 '15 10:12 jwilling

Bounds of the collectionView are fine, if i connect mouse then scroller is making some magic stuff and there is more space, and if i turn off mouse then it is relayouting and content is okay. I will debug it around weekend

m1entus avatar Dec 18 '15 11:12 m1entus

Hi, @m1entus, have you found the solution?

dani-mp avatar Jan 12 '16 17:01 dani-mp

@jwilling Before connecting mouse:

(lldb) po self.collectionView.contentInsets ▿ NSEdgeInsets

  • top : 0.0
  • left : 0.0 { ... }
  • bottom : 0.0 { ... }
  • right : 0.0 { ... }

(lldb) po self.collectionView.contentSize ▿ CGSize

  • width : 151.0
  • height : 440.0

After connecting mouse:

(lldb) po self.collectionView.contentSize ▿ CGSize

  • width : 136.0
  • height : 440.0

(lldb) po self.collectionView.contentInsets ▿ NSEdgeInsets

  • top : 0.0
  • left : 0.0 { ... }
  • bottom : 0.0 { ... }
  • right : 0.0 { ... }

@danielmartinprieto No i haven't found because i didn't invastige to it

m1entus avatar Jan 12 '16 18:01 m1entus

@danielmartinprieto http://stackoverflow.com/questions/15249563/force-nsscrollview-to-use-nsscrollerstyleoverlay-independently-from-input-device this solve issue, i added code to scrollView as a temporary solution

m1entus avatar Jan 12 '16 18:01 m1entus

Ok found solution, preparing PR...

m1entus avatar Jan 12 '16 18:01 m1entus