Commit cd72a66a authored by Jan Hambrecht's avatar Jan Hambrecht

resize gradient fill/stroke when shape is resized

BUG:185954


svn path=/trunk/koffice/; revision=951258
parent 33953714
......@@ -230,6 +230,20 @@ void KoShape::setSize(const QSizeF &newSize)
if (oldSize == newSize)
return;
QMatrix matrix;
matrix.scale(newSize.width()/oldSize.width(), newSize.height()/oldSize.height());
KoGradientBackground * g = dynamic_cast<KoGradientBackground*>(background());
if (g) {
g->setMatrix( g->matrix() * matrix );
}
KoLineBorder * l = dynamic_cast<KoLineBorder*>(border());
if (l && l->lineBrush().gradient()) {
QBrush brush = l->lineBrush();
brush.setMatrix( brush.matrix() * matrix );
l->setLineBrush( brush );
}
d->size = newSize;
notifyChanged();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment