|
13 | 13 | should be included with this source code. |
14 | 14 |
|
15 | 15 | """ |
16 | | -from __future__ import (absolute_import, division, print_function, |
17 | | - unicode_literals) |
18 | 16 |
|
19 | 17 | import six |
20 | 18 |
|
@@ -627,30 +625,11 @@ def __init__(self, parent, id, figure): |
627 | 625 | # Set preferred window size hint - helps the sizer (if one is |
628 | 626 | # connected) |
629 | 627 | l, b, w, h = figure.bbox.bounds |
630 | | - w = int(math.ceil(w)) |
631 | | - h = int(math.ceil(h)) |
| 628 | + w = math.ceil(w) |
| 629 | + h = math.ceil(h) |
632 | 630 |
|
633 | 631 | wx.Panel.__init__(self, parent, id, size=wx.Size(w, h)) |
634 | 632 |
|
635 | | - def do_nothing(*args, **kwargs): |
636 | | - warnings.warn( |
637 | | - "could not find a setinitialsize function for backend_wx; " |
638 | | - "please report your wxpython version=%s " |
639 | | - "to the matplotlib developers list" % |
640 | | - wxc.backend_version) |
641 | | - pass |
642 | | - |
643 | | - # try to find the set size func across wx versions |
644 | | - try: |
645 | | - getattr(self, 'SetInitialSize') |
646 | | - except AttributeError: |
647 | | - self.SetInitialSize = getattr(self, 'SetBestFittingSize', |
648 | | - do_nothing) |
649 | | - |
650 | | - if not hasattr(self, 'IsShownOnScreen'): |
651 | | - self.IsShownOnScreen = getattr(self, 'IsVisible', |
652 | | - lambda *args: True) |
653 | | - |
654 | 633 | # Create the drawing bitmap |
655 | 634 | self.bitmap = wxc.EmptyBitmap(w, h) |
656 | 635 | DEBUG_MSG("__init__() - bitmap w:%d h:%d" % (w, h), 2, self) |
@@ -682,7 +661,10 @@ def do_nothing(*args, **kwargs): |
682 | 661 | self.SetBackgroundStyle(wx.BG_STYLE_PAINT) # Reduce flicker. |
683 | 662 | self.SetBackgroundColour(wx.WHITE) |
684 | 663 |
|
685 | | - self.macros = {} # dict from wx id to seq of macros |
| 664 | + @property |
| 665 | + @cbook.deprecated("3.0") |
| 666 | + def macros(self): |
| 667 | + return {} |
686 | 668 |
|
687 | 669 | def Destroy(self, *args, **kwargs): |
688 | 670 | wx.Panel.Destroy(self, *args, **kwargs) |
@@ -1098,8 +1080,8 @@ def _print_image(self, filename, filetype, *args, **kwargs): |
1098 | 1080 | origBitmap = self.bitmap |
1099 | 1081 |
|
1100 | 1082 | l, b, width, height = self.figure.bbox.bounds |
1101 | | - width = int(math.ceil(width)) |
1102 | | - height = int(math.ceil(height)) |
| 1083 | + width = math.ceil(width) |
| 1084 | + height = math.ceil(height) |
1103 | 1085 |
|
1104 | 1086 | self.bitmap = wxc.EmptyBitmap(width, height) |
1105 | 1087 |
|
|
0 commit comments