pynsource icon indicating copy to clipboard operation
pynsource copied to clipboard

Hard-coded mac style scroll?

Open traverseda opened this issue 6 years ago • 4 comments

Scroll is backwards under my linux system. Looks like you manually reversed the direction of scroll?

traverseda avatar Jul 11 '19 17:07 traverseda

Hi, yes I detect the Mac and reverse scroll direction - the code should not affect linux? e.g.

if event.GetWheelAxis() == wx.MOUSE_WHEEL_VERTICAL:
    v = event.GetWheelRotation()
    if "wxMac" in wx.PlatformInfo:  # natural scrolling - should get from system
        v = -v
    self.Scroll(self.GetScrollPos(wx.HORIZONTAL),
                self.GetScrollPos(wx.VERTICAL) + v)
else:
    self.Scroll(self.GetScrollPos(wx.HORIZONTAL) + event.GetWheelRotation(),
                self.GetScrollPos(wx.VERTICAL))

see line 931 in https://github.com/abulka/pynsource/blob/master/src/gui/uml_canvas.py

abulka avatar Jul 16 '19 08:07 abulka

Huh, I'm definitely getting natural scroll, but only in this one program.

Platform info is as follow:

('__WXGTK__', 'wxGTK',
'unicode', 'unicode-wchar',
'gtk3', 'wx-assertions-on',
'phoenix', 'wxWidgets 3.0.4',
'sip-4.19.16',
'build-type: release')

Getting it both for touch pad and scroll wheel.

traverseda avatar Jul 16 '19 15:07 traverseda

Yeah, I have no idea what could be causing that.

traverseda avatar Jul 16 '19 17:07 traverseda

For now, try changing line 933 of https://github.com/abulka/pynsource/blob/master/src/gui/uml_canvas.py to

if "wxMac" in wx.PlatformInfo or "wxGTK" in wx.PlatformInfo:

abulka avatar Jul 16 '19 21:07 abulka