From f175f2b721744a385b2ead9515fa075f27afa18f Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Fri, 7 Oct 2022 14:32:55 +0200 Subject: [PATCH] Arc added --- support/SkinnyShapeFactory.cpp | 17 +++++++++++++++++ support/SkinnyShapeFactory.h | 1 + 2 files changed, 18 insertions(+) diff --git a/support/SkinnyShapeFactory.cpp b/support/SkinnyShapeFactory.cpp index e892aeba..de9fcbfc 100644 --- a/support/SkinnyShapeFactory.cpp +++ b/support/SkinnyShapeFactory.cpp @@ -150,6 +150,23 @@ QPainterPath SkinnyShapeFactory::shapePath( Shape shape, const QSizeF& size ) path.addPolygon( hexagon ); break; } + case Arc: + { + path.arcMoveTo( rect, -60 ); + path.arcTo( rect, -60, 300 ); + + const double w = 0.25 * rect.width(); + const auto r = rect.adjusted( w, w, -w, -w ); + + QPainterPath innerPath; + + innerPath.arcMoveTo( r, 240 ); + innerPath.arcTo( r, 240, -300 ); + + path.connectPath( innerPath ); + + break; + } default: return QPainterPath(); diff --git a/support/SkinnyShapeFactory.h b/support/SkinnyShapeFactory.h index 42794218..19b940d5 100644 --- a/support/SkinnyShapeFactory.h +++ b/support/SkinnyShapeFactory.h @@ -25,6 +25,7 @@ namespace SkinnyShapeFactory Ring, Star, Hexagon, + Arc, ShapeCount };