Skip to content

Commit

Permalink
view: Ignore background item in fitInView()
Browse files Browse the repository at this point in the history
  • Loading branch information
Tectu committed May 11, 2024
1 parent 2191015 commit d75f9a9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions qschematic/view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ View::fitInView()
// Find the combined bounding rect of all the items
QRectF rect;
for (const auto& item : _scene->QGraphicsScene::items()) {
// Ignore the background item
if (_scene->isBackground(item))
continue;

QRectF boundingRect = item->boundingRect();
boundingRect.moveTo(item->scenePos());
rect = rect.united(boundingRect);
Expand Down

0 comments on commit d75f9a9

Please sign in to comment.