Skip to content
Snippets Groups Projects
Commit f1dc4bd7 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

MaskType -> cast

parent 54c537e2
No related branches found
No related tags found
1 merge request!2252insert IMaskOverlay in class hierarchy, and get rid of MaskType
......@@ -100,16 +100,13 @@ void IMaskOverlay::paint(QPainter* painter, const QStyleOptionGraphicsItem*, QWi
QPainterPath IMaskOverlay::maskedShape() const
{
static const QSet<MaskType> relevantMaskType = {MaskType::RECTANGLE, MaskType::POLYGON,
MaskType::VERTICALLINE,
MaskType::HORIZONTALLINE, MaskType::ELLIPSE};
QPainterPath result = mapToScene(shape());
for (const QGraphicsItem* item : scene()->items()) {
const auto* overlay = dynamic_cast<const IOverlay*>(item);
if (!overlay)
continue;
if (!relevantMaskType.contains((MaskType)overlay->type()))
if (!(dynamic_cast<const IShapeOverlay*>(overlay)
|| dynamic_cast<const ILineOverlay*>(overlay)))
continue;
if (itemMaskValue(overlay->parameterizedItem()))
continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment