element-editor: add rotation-functions to "text" and "dynamic_text"

This commit is contained in:
plc-user
2025-02-16 15:42:33 +01:00
parent 2aeae1fe46
commit da109b1522
5 changed files with 48 additions and 5 deletions

View File

@@ -547,6 +547,14 @@ void RotateElementsCommand::undo()
PartPolygon* poly = qgraphicsitem_cast<PartPolygon*>(item);
poly->setRotation(-90);
}
else if (item->type() == PartText::Type) {
PartText* text = qgraphicsitem_cast<PartText*>(item);
text->setRotation(-90);
}
else if (item->type() == PartDynamicTextField::Type) {
PartDynamicTextField* dyntext = qgraphicsitem_cast<PartDynamicTextField*>(item);
dyntext->setRotation(-90);
}
else {
item->setRotation(item->rotation()-90);
}
@@ -584,6 +592,14 @@ void RotateElementsCommand::redo()
PartPolygon* poly = qgraphicsitem_cast<PartPolygon*>(item);
poly->setRotation(+90);
}
else if (item->type() == PartText::Type) {
PartText* text = qgraphicsitem_cast<PartText*>(item);
text->setRotation(+90);
}
else if (item->type() == PartDynamicTextField::Type) {
PartDynamicTextField* dyntext = qgraphicsitem_cast<PartDynamicTextField*>(item);
dyntext->setRotation(+90);
}
else {
item->setRotation(item->rotation()+90);
}