Avoid unnecessary calls

This commit is contained in:
DarkPhoenix
2019-08-07 23:05:55 +03:00
parent 95621b6aab
commit c559508175

View File

@@ -131,11 +131,9 @@ class AttributeSlider(wx.Panel):
def OnMouseWheel(self, evt):
if evt.GetWheelRotation() > 0 and evt.GetWheelAxis() == wx.MOUSE_WHEEL_VERTICAL:
self.ctrl.Value = self.ctrl.Value + self.ctrl.Increment
self.SetValue(self.GetValue())
self.SetValue(self.ctrl.Value + self.ctrl.Increment)
elif evt.GetWheelRotation() < 0 and evt.GetWheelAxis() == wx.MOUSE_WHEEL_VERTICAL:
self.ctrl.Value = self.ctrl.Value - self.ctrl.Increment
self.SetValue(self.GetValue())
self.SetValue(self.ctrl.Value - self.ctrl.Increment)
else:
evt.Skip()