mirror of
https://github.com/juzzlin/Heimer.git
synced 2025-06-13 00:46:14 +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)
|
QRectF MagicZoom::calculateRectangleByItems(const ItemList & items, bool isForExport)
|
||||||
{
|
{
|
||||||
NodeList nodes;
|
NodeList nodes;
|
||||||
for (auto && item : items) {
|
std::transform(items.begin(), items.end(), std::back_inserter(nodes), [](const auto & item) { return dynamic_cast<NodeP>(item); });
|
||||||
if (const auto node = dynamic_cast<NodeP>(item); node) {
|
nodes.erase(std::remove(nodes.begin(), nodes.end(), nullptr), nodes.end());
|
||||||
nodes.push_back(node);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return calculateRectangleByNodes(nodes, isForExport);
|
return calculateRectangleByNodes(nodes, isForExport);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user