editors/Viewer.py
branchpython3
changeset 3794 36934591f6eb
parent 3792 365f866ee120
child 3894 25e9b557f1b8
equal deleted inserted replaced
3793:9958cf865da0 3794:36934591f6eb
   803                 else:
   803                 else:
   804                     mouse_pos = mouse_event.GetPosition()
   804                     mouse_pos = mouse_event.GetPosition()
   805                 pos = mouse_event.GetLogicalPosition(dc)
   805                 pos = mouse_event.GetLogicalPosition(dc)
   806                 xmax = self.GetScrollRange(wx.HORIZONTAL) - self.GetScrollThumb(wx.HORIZONTAL)
   806                 xmax = self.GetScrollRange(wx.HORIZONTAL) - self.GetScrollThumb(wx.HORIZONTAL)
   807                 ymax = self.GetScrollRange(wx.VERTICAL) - self.GetScrollThumb(wx.VERTICAL)
   807                 ymax = self.GetScrollRange(wx.VERTICAL) - self.GetScrollThumb(wx.VERTICAL)
   808                 scrollx = max(0, round(pos.x * self.ViewScale[0] - mouse_pos.x) / SCROLLBAR_UNIT)
   808                 scrollx = max(0, round(pos.x * self.ViewScale[0] - mouse_pos.x) // SCROLLBAR_UNIT)
   809                 scrolly = max(0, round(pos.y * self.ViewScale[1] - mouse_pos.y) / SCROLLBAR_UNIT)
   809                 scrolly = max(0, round(pos.y * self.ViewScale[1] - mouse_pos.y) // SCROLLBAR_UNIT)
   810                 if scrollx > xmax or scrolly > ymax:
   810                 if scrollx > xmax or scrolly > ymax:
   811                     self.RefreshScrollBars(max(0, scrollx - xmax), max(0, scrolly - ymax))
   811                     self.RefreshScrollBars(max(0, scrollx - xmax), max(0, scrolly - ymax))
   812                     self.Scroll(scrollx, scrolly)
   812                     self.Scroll(scrollx, scrolly)
   813                 else:
   813                 else:
   814                     self.Scroll(scrollx, scrolly)
   814                     self.Scroll(scrollx, scrolly)