mirror of
https://github.com/juzzlin/Heimer.git
synced 2025-06-10 15:53:15 +08:00
Refactor MagicZoom
This commit is contained in:
parent
5e8f8558c0
commit
c467598519
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user