[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] CogVM source as per VMMaker.oscog-eem.2484 (897ef17)

Nicolas Cellier notifications at github.com
Fri Dec 27 11:37:22 UTC 2019


The other question is where the factor `32` comes from...

My understanding is that coordinates are expressed in typesetting points or pica (1/72.27 inches, rounded to 1/72 by Apple and some other software providers) - if current scale factor is = 1.
https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CocoaDrawingGuide/Transforms/Transforms.html
A usual font height is 12 points (1/6 inch), count about 2 points for interline, that makes about 14 points line grid.
Note that a point = a pixel in last century monitors having 72 pixels (dots) per inch, and also in Squeak...

My understanding is that `deltaX` and `deltaY` are in same coordinates units
https://developer.apple.com/documentation/appkit/nsevent/1534158-deltay

We want to convert that to scrolling units.

In Squeak, we convert 120 scrolling units into 3 scrollDelta.
A scrollDelta typically is = lineHeight in text pane and font height in list pane.
So we want 120 scrollUnits = 3 scrollDelta = 36 to 40 points typically.
That makes roughly a factor * 3.

Though, with * 32, OSX trackpad scrolls feel sluggish, it would be far worse with * 3!
It's clear that I missed something...

Unless we should better use `scrollingDeltaY` for scroll wheel events as recommended in the link above...
https://developer.apple.com/documentation/appkit/nsevent/1535387-scrollingdeltay

In which case we should inquire `hasPreciseScrollingDeltas`

I'm not completely satisifed with Apple docs, so scanning github for crowd wisdom
I found example of * 32 in other code bases when not precise:
https://github.com/xi-editor/druid/pull/36/commits/2cf48ec4a5928a58af4960adad4d098026f93a23

This is for OSX > 10.7 which can be tested like this:
https://github.com/OpenTTD/OpenTTD/pull/7109

I will try some experiments...

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/897ef1725e32c2eb3d24e3402b2e95b114b8b28b#commitcomment-36590554
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20191227/90733120/attachment.html>


More information about the Vm-dev mailing list