MCPcopy Create free account
hub / github.com/KDE/labplot / changeZoom

Method changeZoom

src/frontend/worksheet/WorksheetView.cpp:1176–1194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1174}
1175
1176void WorksheetView::changeZoom(QAction* action) {
1177 zoomFitNoneAction->setChecked(true);
1178 m_worksheet->setZoomFit(Worksheet::ZoomFit::None);
1179 if (action == zoomInViewAction)
1180 zoom(1);
1181 else if (action == zoomOutViewAction)
1182 zoom(-1);
1183 else if (action == zoomOriginAction) {
1184 static const float hscale = GuiTools::dpi(this).first / (Worksheet::convertToSceneUnits(1, Worksheet::Unit::Inch));
1185 static const float vscale = GuiTools::dpi(this).second / (Worksheet::convertToSceneUnits(1, Worksheet::Unit::Inch));
1186 setTransform(QTransform::fromScale(hscale, vscale));
1187 }
1188
1189 currentZoomAction = action;
1190 if (tbZoom)
1191 tbZoom->setDefaultAction(action);
1192
1193 updateLabelsZoom();
1194}
1195
1196void WorksheetView::updateFit() {
1197 switch (m_worksheet->zoomFit()) {

Callers

nothing calls this directly

Calls 1

setZoomFitMethod · 0.80

Tested by

no test coverage detected