refactor[deiagram editor]: mutualize code.

The features used to jump to linked element and xref now use the same
function.
This commit is contained in:
joshua
2025-10-20 22:58:12 +02:00
parent f74fed9f3f
commit e26f7fdaaa
3 changed files with 6 additions and 45 deletions

View File

@@ -1277,18 +1277,8 @@ void DynamicElementTextItem::zoomToLinkedElement()
//move when linked element is in the same scene of this.
setSelected(false);
ungrabMouse();
if(scene() != zoomed_element->scene())
zoomed_element->diagram()->showMe();
zoomed_element->setSelected(true);
//Zoom to the element
for(QGraphicsView *view : zoomed_element->scene()->views())
{
QRectF fit = zoomed_element->sceneBoundingRect();
fit.adjust(-200, -200, 200, 200);
view->fitInView(fit, Qt::KeepAspectRatioByExpanding);
}
QetGraphicsItem::showItem(zoomed_element);
}
}