|
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 |
|
@@ -606,30 +604,11 @@ def __init__(self, parent, id, figure): |
606 | 604 | # Set preferred window size hint - helps the sizer (if one is |
607 | 605 | # connected) |
608 | 606 | l, b, w, h = figure.bbox.bounds |
609 | | - w = int(math.ceil(w)) |
610 | | - h = int(math.ceil(h)) |
| 607 | + w = math.ceil(w) |
| 608 | + h = math.ceil(h) |
611 | 609 |
|
612 | 610 | wx.Panel.__init__(self, parent, id, size=wx.Size(w, h)) |
613 | 611 |
|
614 | | - def do_nothing(*args, **kwargs): |
615 | | - warnings.warn( |
616 | | - "could not find a setinitialsize function for backend_wx; " |
617 | | - "please report your wxpython version=%s " |
618 | | - "to the matplotlib developers list" % |
619 | | - wxc.backend_version) |
620 | | - pass |
621 | | - |
622 | | - # try to find the set size func across wx versions |
623 | | - try: |
624 | | - getattr(self, 'SetInitialSize') |
625 | | - except AttributeError: |
626 | | - self.SetInitialSize = getattr(self, 'SetBestFittingSize', |
627 | | - do_nothing) |
628 | | - |
629 | | - if not hasattr(self, 'IsShownOnScreen'): |
630 | | - self.IsShownOnScreen = getattr(self, 'IsVisible', |
631 | | - lambda *args: True) |
632 | | - |
633 | 612 | # Create the drawing bitmap |
634 | 613 | self.bitmap = wxc.EmptyBitmap(w, h) |
635 | 614 | DEBUG_MSG("__init__() - bitmap w:%d h:%d" % (w, h), 2, self) |
@@ -661,7 +640,10 @@ def do_nothing(*args, **kwargs): |
661 | 640 | self.SetBackgroundStyle(wx.BG_STYLE_PAINT) # Reduce flicker. |
662 | 641 | self.SetBackgroundColour(wx.WHITE) |
663 | 642 |
|
664 | | - self.macros = {} # dict from wx id to seq of macros |
| 643 | + @property |
| 644 | + @cbook.deprecated("3.0") |
| 645 | + def macros(self): |
| 646 | + return {} |
665 | 647 |
|
666 | 648 | def Destroy(self, *args, **kwargs): |
667 | 649 | wx.Panel.Destroy(self, *args, **kwargs) |
@@ -1082,8 +1064,8 @@ def _print_image(self, filename, filetype, *args, **kwargs): |
1082 | 1064 | origBitmap = self.bitmap |
1083 | 1065 |
|
1084 | 1066 | l, b, width, height = self.figure.bbox.bounds |
1085 | | - width = int(math.ceil(width)) |
1086 | | - height = int(math.ceil(height)) |
| 1067 | + width = math.ceil(width) |
| 1068 | + height = math.ceil(height) |
1087 | 1069 |
|
1088 | 1070 | self.bitmap = wxc.EmptyBitmap(width, height) |
1089 | 1071 |
|
|
0 commit comments