comparison Framework/Widgets/WorldSceneWidget.cpp @ 313:8bdc6112bc2e am-2

initial resize of canvas
author am@osimis.io
date Wed, 03 Oct 2018 17:01:05 +0200
parents 300d8b8c48b3
children 8716176ff7f0
comparison
equal deleted inserted replaced
312:a91ad36b684c 313:8bdc6112bc2e
22 #include "WorldSceneWidget.h" 22 #include "WorldSceneWidget.h"
23 23
24 #include <math.h> 24 #include <math.h>
25 #include <memory> 25 #include <memory>
26 #include <cassert> 26 #include <cassert>
27 #include "Core/Logging.h"
27 28
28 namespace OrthancStone 29 namespace OrthancStone
29 { 30 {
30 static void MapMouseToScene(double& sceneX, 31 static void MapMouseToScene(double& sceneX,
31 double& sceneY, 32 double& sceneY,
136 static const double MIN_ZOOM = -4; 137 static const double MIN_ZOOM = -4;
137 static const double MAX_ZOOM = 4; 138 static const double MAX_ZOOM = 4;
138 139
139 if (that_.view_.GetDisplayHeight() <= 3) 140 if (that_.view_.GetDisplayHeight() <= 3)
140 { 141 {
141 return; // Cannot zoom on such a small image 142 LOG(WARNING) << "image is too small to zoom (current height = " << that_.view_.GetDisplayHeight() << ")";
143 return;
142 } 144 }
143 145
144 double dy = (static_cast<double>(y - downY_) / 146 double dy = (static_cast<double>(y - downY_) /
145 static_cast<double>(that_.view_.GetDisplayHeight() - 1)); // In the range [-1,1] 147 static_cast<double>(that_.view_.GetDisplayHeight() - 1)); // In the range [-1,1]
146 double z; 148 double z;