Sync graphics item with matrix and shadow common parameters.
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "LabelModelObject.h"
|
||||
|
||||
#include <QGraphicsDropShadowEffect>
|
||||
|
||||
|
||||
namespace glabels
|
||||
{
|
||||
@@ -178,5 +180,26 @@ namespace glabels
|
||||
emit changed();
|
||||
}
|
||||
|
||||
|
||||
void LabelModelObject::updateGraphicsItemMatrix( QGraphicsItem* graphicsItem )
|
||||
{
|
||||
graphicsItem->setTransform( mMatrix );
|
||||
}
|
||||
|
||||
|
||||
void LabelModelObject::updateGraphicsItemShadow( QGraphicsItem* graphicsItem )
|
||||
{
|
||||
QGraphicsDropShadowEffect *shadowEffect = new QGraphicsDropShadowEffect();
|
||||
|
||||
QColor color = mShadowColorNode.color();
|
||||
color.setAlphaF( mShadowOpacity );
|
||||
|
||||
shadowEffect->setColor( color );
|
||||
shadowEffect->setOffset( mShadowX, mShadowY );
|
||||
shadowEffect->setBlurRadius( 0 );
|
||||
|
||||
graphicsItem->setGraphicsEffect( shadowEffect );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user