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 d7245b8d authored by Yue Liu's avatar Yue Liu

fixed select and update to connectors

parent bbaad854
......@@ -392,7 +392,7 @@ void ConnectionTool::mouseMoveEvent(KoPointerEvent *event)
useCursor(Qt::ArrowCursor);
}
} else {// Idle and no current strategy
KoShape *hoverShape = findNonConnectionShapeAtPosition(event->point);
KoShape *hoverShape = findShapeAtPosition(event->point);
int hoverHandle = -1;
if (hoverShape) {
KoConnectionShape * connectionShape = dynamic_cast<KoConnectionShape*>(hoverShape);
......@@ -478,8 +478,8 @@ void ConnectionTool::mouseDoubleClickEvent(KoPointerEvent *event)
//deactivate connection tool when double click blank region on canvas
KoShape *hitShape = findShapeAtPosition(event->point);
if (!hitShape) {
deactivate();
emit done();
deactivate();
emit done();
} else if (dynamic_cast<KoConnectionShape*>(hitShape)) {
repaintDecorations();
setEditMode(EditConnection, m_currentShape, -1);
......@@ -539,7 +539,16 @@ KoShape * ConnectionTool::findShapeAtPosition(const QPointF &position) const
// is not at the top of the shape stack at the mouse position
KoConnectionShape *connectionShape = nearestConnectionShape(shapes, position);
// use best connection shape or first shape from stack (last in the list) if not found
return connectionShape ? connectionShape : shapes.last();
if (connectionShape) {
return connectionShape;
} else {
for (QList<KoShape*>::const_iterator end = shapes.constEnd()-1; end >= shapes.constBegin(); end--) {
KoShape* shape = *end;
if (!dynamic_cast<KoConnectionShape*>(shape) && shape->shapeId() != TextShape_SHAPEID) {
return shape;
}
}
}
}
return 0;
......
......@@ -36,7 +36,7 @@ ShapeMoveStrategy::ShapeMoveStrategy(KoToolBase *tool, const QPointF &clicked)
: KoInteractionStrategy(tool),
m_start(clicked)
{
QList<KoShape*> selectedShapes = tool->canvas()->shapeManager()->selection()->selectedShapes(KoFlake::TopLevelSelection);
QList<KoShape*> selectedShapes = tool->canvas()->shapeManager()->selection()->selectedShapes(KoFlake::StrippedSelection);
QRectF boundingRect;
foreach(KoShape *shape, selectedShapes) {
if (! shape->isEditable())
......
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