| 641 | # line is run, leading to a useless AttributeError. |
| 642 | |
| 643 | def resize(self, width, height): |
| 644 | # The Qt methods return sizes in 'virtual' pixels so we do need to |
| 645 | # rescale from physical to logical pixels. |
| 646 | width = int(width / self.canvas.device_pixel_ratio) |
| 647 | height = int(height / self.canvas.device_pixel_ratio) |
| 648 | extra_width = self.window.width() - self.canvas.width() |
| 649 | extra_height = self.window.height() - self.canvas.height() |
| 650 | self.canvas.resize(width, height) |
| 651 | self.window.resize(width + extra_width, height + extra_height) |
| 652 | |
| 653 | @classmethod |
| 654 | def start_main_loop(cls): |