summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-07 23:52:10 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-10-07 23:52:10 (GMT)
commitd208d824f48b8e6de62680eb35e535850e050b92 (patch)
treefca49bdee7b51f178ae416fb8eb65445302466de
parent367b94cd51582de0d749edd4a9c36b3c9f897a6f (diff)
Zoom to center by default
-rw-r--r--kstars/fitsviewer/fitsview.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/kstars/fitsviewer/fitsview.cpp b/kstars/fitsviewer/fitsview.cpp
index 528c7f6..4582069 100644
--- a/kstars/fitsviewer/fitsview.cpp
+++ b/kstars/fitsviewer/fitsview.cpp
@@ -829,6 +829,7 @@ void FITSView::wheelEvent(QWheelEvent* event)
event->accept();
+ // Center toward marked crosshair
if (markerCrosshair.isNull() == false)
{
int x0 = markerCrosshair.x() * (currentZoom / ZOOM_DEFAULT);
@@ -836,6 +837,7 @@ void FITSView::wheelEvent(QWheelEvent* event)
ensureVisible(x0,y0, image_width/2, image_height/2);
}
+ // Otherwise tracking box
else if (trackingBoxEnabled)
{
int x0 = trackingBox.x() * (currentZoom / ZOOM_DEFAULT);
@@ -843,6 +845,14 @@ void FITSView::wheelEvent(QWheelEvent* event)
ensureVisible(x0,y0, image_width/2, image_height/2);
}
+ // Other just center
+ else
+ {
+ QPoint center = viewport()->rect().center();
+ int x0 = center.x() * (currentZoom / ZOOM_DEFAULT);
+ int y0 = center.y() * (currentZoom / ZOOM_DEFAULT);
+ ensureVisible(x0,y0, image_width/2, image_height/2);
+ }
}
void FITSView::initDisplayImage()