2020"""
2121
2222from .qt .QtGui import (QWidget , QFont , QSizePolicy , QFrame , QApplication ,
23- QRegion , QPainter , QPalette )
23+ QRegion , QPainter , QPalette )
2424from .qt .QtCore import Qt , Signal , QEvent , QSize , QRectF
2525
2626from .text import QwtText , QwtTextLabel
@@ -1206,9 +1206,12 @@ def updateLayout(self):
12061206 self .__data .footerLabel .hide ()
12071207
12081208 for axisId in self .validAxes :
1209+ scaleWidget = self .axisWidget (axisId )
12091210 if self .axisEnabled (axisId ):
1210- self .axisWidget (axisId ).setGeometry (scaleRect [axisId ])
1211-
1211+ if scaleRect [axisId ] != scaleWidget .geometry ():
1212+ scaleWidget .setGeometry (scaleRect [axisId ])
1213+ startDist , endDist = scaleWidget .getBorderDistHint ()
1214+ scaleWidget .setBorderDist (startDist , endDist )
12121215 if axisId in (self .xBottom , self .xTop ):
12131216 r = QRegion (scaleRect [axisId ])
12141217 if self .axisEnabled (self .yLeft ):
@@ -1217,13 +1220,13 @@ def updateLayout(self):
12171220 r = r .subtracted (QRegion (scaleRect [self .yRight ]))
12181221 r .translate (- scaleRect [axisId ].x (), - scaleRect [axisId ].y ())
12191222
1220- self . axisWidget ( axisId ) .setMask (r )
1223+ scaleWidget .setMask (r )
12211224
1222- if not self . axisWidget ( axisId ) .isVisibleTo (self ):
1223- self . axisWidget ( axisId ) .show ()
1225+ if not scaleWidget .isVisibleTo (self ):
1226+ scaleWidget .show ()
12241227
12251228 else :
1226- self . axisWidget ( axisId ) .hide ()
1229+ scaleWidget .hide ()
12271230
12281231 if self .__data .legend :
12291232 if self .__data .legend .isEmpty ():
0 commit comments