trigger updates on eometry changes (
https://github.com/uwerat/qskinny/issues/379 )
This commit is contained in:
parent
2e34bfd4c6
commit
9117ccce1d
@ -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 )
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user