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

Method zoom100

modules/QtPDF/src/PDFDocumentView.cpp:720–738  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

718
719
720void PDFDocumentView::zoom100()
721{
722 // Reset zoom level to 100%
723
724 // Reset the view scale to 1:1.
725 QRectF unity = transform().mapRect(QRectF(0, 0, 1, 1));
726 if (unity.isEmpty())
727 return;
728
729 // Set the transformation anchor to AnchorViewCenter so we always zoom out of
730 // the center of the view (rather than out of the upper left corner)
731 QGraphicsView::ViewportAnchor anchor = transformationAnchor();
732 setTransformationAnchor(QGraphicsView::AnchorViewCenter);
733 scale(1 / unity.width(), 1 / unity.height());
734 setTransformationAnchor(anchor);
735
736 _zoomLevel = transform().m11();
737 emit changedZoom(_zoomLevel);
738}
739
740void PDFDocumentView::setMouseMode(const MouseMode newMode)
741{

Callers 1

setDefaultScaleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected