MCPcopy Create free account
hub / github.com/XRay3D/GERBER_X3 / zoomToSelected

Method zoomToSelected

static_libs/graphicsview/graphicsview.cpp:145–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143void GraphicsView::zoomFit() { fitInView(scene()->itemsBoundingRect(), false); }
144
145void GraphicsView::zoomToSelected()
146{
147 QRectF rect;
148 for (const QGraphicsItem* item : scene()->selectedItems()) {
149 const QRectF tmpRect(item->pos().isNull() ? item->boundingRect() : item->boundingRect().translated(item->pos()));
150 rect = /*rect.isEmpty() ? tmpRect :*/ rect.united(tmpRect);
151 }
152 if (rect.isEmpty())
153 return;
154 fitInView(rect);
155}
156
157void GraphicsView::zoom100()
158{

Callers 2

MainWindowMethod · 0.80
zoonToSelectedMethod · 0.80

Calls 4

isEmptyMethod · 0.80
isNullMethod · 0.45
posMethod · 0.45
boundingRectMethod · 0.45

Tested by

no test coverage detected