Commit 0502a9d5 authored by Thorsten Zachmann's avatar Thorsten Zachmann
Browse files

Load draw:corner-radius correctly

Thr draw:corner-radius can be bigger then the actual shape is wide or high. In that case
make the radius half the width/height.

This fixes the problem that the shape in bug 260226 is shown as big as it should.

The actual problem described in the bug report had already be fixed.

Ok to backport?

BUG: 260226
parent 90de9b5e
......@@ -61,8 +61,8 @@ bool RectangleShape::loadOdf(const KoXmlElement &element, KoShapeLoadingContext
QString cornerRadius = element.attributeNS(KoXmlNS::draw, "corner-radius", "");
if (! cornerRadius.isEmpty()) {
float radius = KoUnit::parseValue(cornerRadius);
m_cornerRadiusX = radius / (0.5 * size().width()) * 100;
m_cornerRadiusY = radius / (0.5 * size().height()) * 100;
m_cornerRadiusX = qMin(radius / (0.5 * size().width()) * 100, qreal(100));
m_cornerRadiusY = qMin(radius / (0.5 * size().height()) * 100, qreal(100));
}
}
......
Supports Markdown
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