Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 9053a678 authored by Yue Liu's avatar Yue Liu

removed glue points remove restriction

parent 24c47d36
......@@ -1779,7 +1779,6 @@ void KoShape::loadOdfGluePoints(const KoXmlElement &element, KoShapeLoadingConte
if (!hasCenterGluePoint) {
d->connectors[d->connectors.count()] = KoConnectionPoint(QPointF(0.5, 0.5),
KoConnectionPoint::AllDirections, KoConnectionPoint::AlignCenter);
kDebug(30006) << "center glue-point added at id " << index;
}
kDebug(30006) << "shape has now" << d->connectors.count() << "glue-points";
}
......
......@@ -472,19 +472,7 @@ void ConnectionTool::mouseDoubleClickEvent(KoPointerEvent *event)
QPointF point = m_currentShape->documentToShape(mousePos);
canvas()->addCommand(new AddConnectionPointCommand(m_currentShape, point));
} else {
// don't remove last center glue point since we want it to be "default"
bool dontRemove = m_currentShape->connectionPoint(handleId).position == QPointF(0.5, 0.5);
int centerGluePointCount = 0;
KoConnectionPoints::const_iterator i;
for (i=m_currentShape->connectionPoints().constBegin();
i!=m_currentShape->connectionPoints().constEnd(); ++i) {
if (i.value().position == QPointF(0.5, 0.5)) {
centerGluePointCount++;
}
}
if (!dontRemove || (dontRemove && centerGluePointCount > 1)) {
canvas()->addCommand(new RemoveConnectionPointCommand(m_currentShape, handleId));
}
canvas()->addCommand(new RemoveConnectionPointCommand(m_currentShape, handleId));
}
setEditMode(m_editMode, m_currentShape, -1);
} else {
......@@ -935,20 +923,8 @@ void ConnectionTool::deleteSelection()
{
if (m_editMode == EditConnectionPoint && m_currentShape && m_activeHandle >= 0) {
repaintDecorations();
// don't remove last center glue point since we want it to be "default"
bool dontRemove = m_currentShape->connectionPoint(m_activeHandle).position == QPointF(0.5, 0.5);
int centerGluePointCount = 0;
KoConnectionPoints::const_iterator i;
for (i=m_currentShape->connectionPoints().constBegin();
i!=m_currentShape->connectionPoints().constEnd(); ++i) {
if (i.value().position == QPointF(0.5, 0.5)) {
centerGluePointCount++;
}
}
if (!dontRemove || (dontRemove && centerGluePointCount > 1)) {
canvas()->addCommand(new RemoveConnectionPointCommand(m_currentShape, m_activeHandle));
setEditMode(m_editMode, m_currentShape, -1);
}
canvas()->addCommand(new RemoveConnectionPointCommand(m_currentShape, m_activeHandle));
setEditMode(m_editMode, m_currentShape, -1);
} else if (m_editMode == EditConnection && m_currentShape) {
repaintDecorations();
canvas()->addCommand(canvas()->shapeController()->removeShape(m_currentShape));
......
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