diff --git a/src/tools/arrow/arrowtool.cpp b/src/tools/arrow/arrowtool.cpp index e3109bd8..0890098c 100644 --- a/src/tools/arrow/arrowtool.cpp +++ b/src/tools/arrow/arrowtool.cpp @@ -14,7 +14,7 @@ QPainterPath getArrowHead(QPoint p1, QPoint p2, const int thickness) // Create the vector for the position of the base of the arrowhead QLineF temp(QPoint(0, 0), p2 - p1); int val = ArrowHeight + thickness * 4; - if (base.length() < val) { + if (base.length() < (val - thickness * 2)) { val = static_cast(base.length() + thickness * 2); } temp.setLength(base.length() + thickness * 2 - val); @@ -45,10 +45,13 @@ QLine getShorterLine(QPoint p1, QPoint p2, const int thickness) { QLineF l(p1, p2); int val = ArrowHeight + thickness * 4; - if (l.length() < val) { - val = static_cast(l.length() + thickness * 2); - } - l.setLength(l.length() + thickness * 2 - val); + if (l.length() < (val - thickness * 2)) { + // here should be 0, but then we lose "angle", so this is hack, but + // looks not very bad + val = thickness / 4; + l.setLength(val); + } else + l.setLength(l.length() + thickness * 2 - val); return l.toLine(); }