Commit 9a98faaa authored by Juan Palacios's avatar Juan Palacios
Browse files

Fixed aspect ratio computation of artistic text shape

Aspect ratio was not being computed correctly. Now artistic shape
maintain the aspect ratio of the box used to define the text area,
keeping the defined height and extending the width to accommodate the
predefined text.

CCBUG: 305323
parent 282ce4ce
......@@ -110,8 +110,8 @@ void KisToolText::finishRect(const QRectF &rect)
shape->setPosition(r.topLeft());
// If the shape is an artistic shape we keep the aspect ratio so the text isn't stretched
if (shapeString == "ArtisticText") {
qreal ratio = rect.height()/shape->size().height();
r.setWidth(shape->size().width()*ratio);
qreal ratio = shape->size().width() / shape->size().height();
r.setWidth(convertToPt(rect).height() * ratio);
}
shape->setSize(r.size());
addShape(shape);
......
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