abulka / pynsource

Reverse engineer Python source code into UML
http://pynsource.com
283 stars 40 forks source link

Hard-coded mac style scroll? #58

Open traverseda opened 5 years ago

traverseda commented 5 years ago

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

abulka commented 5 years ago

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

traverseda commented 5 years ago

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 commented 5 years ago

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

abulka commented 5 years ago

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: