Merge pull request #1152 from ispyisail/fix/1145-align-shapes

Fix #1145: let Align and Snap to grid move drawn shapes
This commit is contained in:
Laurent Trinques
2026-09-29 12:31:24 +02:00
committed by GitHub
5 changed files with 127 additions and 86 deletions
+4 -5
View File
@@ -2207,7 +2207,7 @@ void QETDiagramEditor::alignGroupTriggered(QAction *action)
if (mode == AlignSelectionCommand::SnapToGrid)
message = tr("La sélection est déjà sur la grille");
else if (command->itemCount() < 2)
message = tr("Sélectionnez au moins deux éléments, images, textes ou groupes non verrouillés");
message = tr("Sélectionnez au moins deux éléments, images, textes, formes ou groupes non verrouillés");
else
message = tr("La sélection est déjà alignée, à la grille près");
delete command;
@@ -2487,11 +2487,10 @@ void QETDiagramEditor::slot_updateComplexActions()
| DiagramContent::Images);
m_depth_action_group->setEnabled(list.isEmpty()? false : true);
//Align actions: symbols, pictures and free texts take part.
//Align actions: symbols, pictures, free texts and shapes take part,
//counted the way the command counts them, a group as one.
//Snapping needs one of them, lining them up needs two.
const int alignable = selected_elements_count
+ selected_image
+ dc.count(DiagramContent::TextFields);
const int alignable = AlignSelectionCommand::unitCount(dc);
m_align_actions_group.setEnabled(!ro && alignable);
const QList<QAction *> align_actions = m_align_actions_group.actions();
for (QAction *action : align_actions.mid(1))