Commit cdd0cd6a authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Fix offset for circular shape.

parent 97372d6e
...@@ -1285,7 +1285,7 @@ QPointF KisVisualEllipticalSelectorShape::convertShapeCoordinateToWidgetCoordina ...@@ -1285,7 +1285,7 @@ QPointF KisVisualEllipticalSelectorShape::convertShapeCoordinateToWidgetCoordina
} }
line.setAngle(angle); line.setAngle(angle);
if (getDimensions()!=KisVisualColorSelectorShape::onedimensional) { if (getDimensions()!=KisVisualColorSelectorShape::onedimensional) {
line.setLength(coordinate.y()*a-offset); line.setLength(qMin(coordinate.y()*(a-offset), a-offset));
} }
x = qRound(line.p2().x()); x = qRound(line.p2().x());
y = qRound(line.p2().y()); y = qRound(line.p2().y());
...@@ -1300,7 +1300,7 @@ QPointF KisVisualEllipticalSelectorShape::convertWidgetCoordinateToShapeCoordina ...@@ -1300,7 +1300,7 @@ QPointF KisVisualEllipticalSelectorShape::convertWidgetCoordinateToShapeCoordina
qreal offset = 7.0; qreal offset = 7.0;
QRect total(0, 0, width(), height()); QRect total(0, 0, width(), height());
QLineF line(total.center(), coordinate); QLineF line(total.center(), coordinate);
qreal a = (total.width()/2)-offset; qreal a = (total.width()/2);
qreal angle; qreal angle;
if (m_type!=KisVisualEllipticalSelectorShape::borderMirrored){ if (m_type!=KisVisualEllipticalSelectorShape::borderMirrored){
...@@ -1309,7 +1309,7 @@ QPointF KisVisualEllipticalSelectorShape::convertWidgetCoordinateToShapeCoordina ...@@ -1309,7 +1309,7 @@ QPointF KisVisualEllipticalSelectorShape::convertWidgetCoordinateToShapeCoordina
angle = angle+180.0; angle = angle+180.0;
x = angle/360.0; x = angle/360.0;
if (getDimensions()==KisVisualColorSelectorShape::twodimensional) { if (getDimensions()==KisVisualColorSelectorShape::twodimensional) {
y = qBound(0.0,(line.length())/a, 1.0); y = qBound(0.0,line.length()/(a-offset), 1.0);
} }
} else { } else {
...@@ -1320,7 +1320,7 @@ QPointF KisVisualEllipticalSelectorShape::convertWidgetCoordinateToShapeCoordina ...@@ -1320,7 +1320,7 @@ QPointF KisVisualEllipticalSelectorShape::convertWidgetCoordinateToShapeCoordina
} }
x = (angle/360.0)*2; x = (angle/360.0)*2;
if (getDimensions()==KisVisualColorSelectorShape::twodimensional) { if (getDimensions()==KisVisualColorSelectorShape::twodimensional) {
y = qBound(0.0,(line.length())/a, 1.0); y = qBound(0.0,(line.length()+offset)/a, 1.0);
} }
} }
......
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