Commit 64b968f70fa4d1ff0848f830510f3e46dcb3e835
1 parent
49f7db81
Exists in
master
and in
68 other branches
FIX: Getting the right size when sizing or maximizing the viewer_slice
Showing
1 changed file
with
2 additions
and
7 deletions
Show diff stats
invesalius/data/viewer_slice.py
| ... | ... | @@ -816,7 +816,7 @@ class Viewer(wx.Panel): |
| 816 | 816 | #self.scroll.Bind(wx.EVT_SCROLL_ENDSCROLL, self.OnScrollBarRelease) |
| 817 | 817 | self.interactor.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) |
| 818 | 818 | self.interactor.Bind(wx.EVT_RIGHT_UP, self.OnContextMenu) |
| 819 | - self.Bind(wx.EVT_SIZE, self.OnSize) | |
| 819 | + self.interactor.Bind(wx.EVT_SIZE, self.OnSize) | |
| 820 | 820 | |
| 821 | 821 | def LoadImagedata(self, pubsub_evt): |
| 822 | 822 | imagedata, mask_dict = pubsub_evt.data |
| ... | ... | @@ -1215,12 +1215,7 @@ class Viewer(wx.Panel): |
| 1215 | 1215 | evt.Skip() |
| 1216 | 1216 | |
| 1217 | 1217 | def OnSize(self, evt): |
| 1218 | - w, h = self.interactor.GetRenderWindow().GetSize() | |
| 1219 | - print "OnSize" | |
| 1220 | - print w, h | |
| 1221 | - print evt.GetSize() | |
| 1222 | - print self.interactor.GetRenderWindow().GetPosition() | |
| 1223 | ||
| 1218 | + w, h = evt.GetSize() | |
| 1224 | 1219 | w = float(w) / self.layout[0] |
| 1225 | 1220 | h = float(h) / self.layout[1] |
| 1226 | 1221 | for slice_data in self.slice_data_list: | ... | ... |