MCPcopy Create free account
hub / github.com/TeXworks/texworks / zoomToRect

Method zoomToRect

modules/QtPDF/src/PDFDocumentView.cpp:631–641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629void PDFDocumentView::zoomOut(const QGraphicsView::ViewportAnchor anchor /* = QGraphicsView::AnchorViewCenter */) { zoomBy(2.0/3.0, anchor); }
630
631void PDFDocumentView::zoomToRect(QRectF a_rect)
632{
633 // NOTE: The argument, `a_rect`, is assumed to be in _scene coordinates_.
634 fitInView(a_rect, Qt::KeepAspectRatio);
635
636 // Since we passed `Qt::KeepAspectRatio` to `fitInView` both x and y scaling
637 // factors were changed by the same amount. So we'll just take the x scale to
638 // be the new `_zoomLevel`.
639 _zoomLevel = transform().m11();
640 emit changedZoom(_zoomLevel);
641}
642
643void PDFDocumentView::zoomFitWindow()
644{

Callers 1

mouseReleaseEventMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected