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

.

parent ff1a5ea5
No related branches found
No related tags found
1 merge request!2127simplifications in mask context
Pipeline #119798 failed
......@@ -495,12 +495,11 @@ bool MaskGraphicsScene::isValidForRectangleShapeDrawing(QGraphicsSceneMouseEvent
return false;
if (isAreaContains(event, MaskType::SIZEHANDLE))
return false;
if (m_activity == MaskEditorFlags::ROI_MODE) {
if (m_activity == MaskEditorFlags::ROI_MODE)
// only one ROI is allowed
for (MaskRoot* item : m_ItemToView.keys())
if (dynamic_cast<RegionOfInterestItem*>(item))
return false;
}
return true;
}
......@@ -510,10 +509,9 @@ bool MaskGraphicsScene::isValidForPolygonDrawing(QGraphicsSceneMouseEvent* event
{
if (m_activity != MaskEditorFlags::POLYGON_MODE)
return false;
if (!m_drawing_in_progress) {
if (!m_drawing_in_progress)
if (isAreaContains(event, MaskType::POLYGONPOINT))
return false;
}
return true;
}
......@@ -525,11 +523,10 @@ bool MaskGraphicsScene::isValidForLineDrawing(QGraphicsSceneMouseEvent* event) c
return false;
if (!::isLineMode(m_activity))
return false;
if (QGraphicsItem* graphicsItem = itemAt(event->scenePos(), QTransform())) {
if (QGraphicsItem* graphicsItem = itemAt(event->scenePos(), QTransform()))
if (graphicsItem->type() == MaskType::VERTICALLINE
|| graphicsItem->type() == MaskType::HORIZONTALLINE)
return false;
}
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment