diff --git a/src/controls/QskGraphicLabel.cpp b/src/controls/QskGraphicLabel.cpp index 0f05e4dc..59846418 100644 --- a/src/controls/QskGraphicLabel.cpp +++ b/src/controls/QskGraphicLabel.cpp @@ -10,6 +10,7 @@ #include "QskGraphicProvider.h" #include "QskSkinManager.h" #include "QskSkin.h" +#include "QskEvent.h" QSK_SUBCONTROL( QskGraphicLabel, Panel ) QSK_SUBCONTROL( QskGraphicLabel, Graphic ) @@ -305,6 +306,25 @@ QSizeF QskGraphicLabel::effectiveSourceSize() const return sz; } +void QskGraphicLabel::geometryChangeEvent( QskGeometryChangeEvent* event ) +{ + /* + textures will finally be scaled into a target rectangle in integer + coordinates. This rectangle might have a different size - depending + on how its coordinates are rounded ( ceiled/floored ) - even if + the site in floating point coordinates is the same. + + So we always trigger updates - even for translations. + + Note that an update triggers the checks, that are needed to decide if + the texture needs to be recreated - it does not necessarily + result in actually doing it. + */ + update(); + + Inherited::geometryChangeEvent( event ); +} + void QskGraphicLabel::changeEvent( QEvent* event ) { if ( event->type() == QEvent::StyleChange ) diff --git a/src/controls/QskGraphicLabel.h b/src/controls/QskGraphicLabel.h index 12a12881..ebb0c83a 100644 --- a/src/controls/QskGraphicLabel.h +++ b/src/controls/QskGraphicLabel.h @@ -105,7 +105,9 @@ class QSK_EXPORT QskGraphicLabel : public QskControl void setGraphic( const QskGraphic& ); protected: + void geometryChangeEvent( QskGeometryChangeEvent* ) override; void changeEvent( QEvent* ) override; + void updateResources() override; virtual QskGraphic loadSource( const QUrl& ) const;