1
0
mirror of https://github.com/juzzlin/Heimer.git synced 2025-06-10 15:53:15 +08:00

Refactor MagicZoom

This commit is contained in:
Jussi Lind 2024-06-09 14:19:31 +03:00
parent 5e8f8558c0
commit c467598519

View File

@ -24,12 +24,8 @@
QRectF MagicZoom::calculateRectangleByItems(const ItemList & items, bool isForExport)
{
NodeList nodes;
for (auto && item : items) {
if (const auto node = dynamic_cast<NodeP>(item); node) {
nodes.push_back(node);
}
}
std::transform(items.begin(), items.end(), std::back_inserter(nodes), [](const auto & item) { return dynamic_cast<NodeP>(item); });
nodes.erase(std::remove(nodes.begin(), nodes.end(), nullptr), nodes.end());
return calculateRectangleByNodes(nodes, isForExport);
}