Commit 0bb7043b 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.

BUG: 260226
Reviewed by: boemann
(cherry picked from commit 0502a9d5)
parent ee0c1ee2
......@@ -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