Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/ViewportController.cpp @ 1053:32b403a47b19
simplifying IViewport
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 10 Oct 2019 15:24:48 +0200 |
parents | 348866dd217c |
children | e713f1a99861 2d8ab34c8c91 |
comparison
equal
deleted
inserted
replaced
1052:0cc62db7e61b | 1053:32b403a47b19 |
---|---|
166 BroadcastMessage(SceneTransformChanged(*this)); | 166 BroadcastMessage(SceneTransformChanged(*this)); |
167 } | 167 } |
168 | 168 |
169 void ViewportController::FitContent() | 169 void ViewportController::FitContent() |
170 { | 170 { |
171 viewport_.GetScene().FitContent(viewport_.GetCanvasWidth(), viewport_.GetCanvasHeight()); | 171 if (viewport_.HasCompositor()) |
172 BroadcastMessage(SceneTransformChanged(*this)); | 172 { |
173 const ICompositor& compositor = viewport_.GetCompositor(); | |
174 viewport_.GetScene().FitContent(compositor.GetCanvasWidth(), compositor.GetCanvasHeight()); | |
175 BroadcastMessage(SceneTransformChanged(*this)); | |
176 } | |
173 } | 177 } |
174 | 178 |
175 void ViewportController::AddMeasureTool(boost::shared_ptr<MeasureTool> measureTool) | 179 void ViewportController::AddMeasureTool(boost::shared_ptr<MeasureTool> measureTool) |
176 { | 180 { |
177 ORTHANC_ASSERT(std::find(measureTools_.begin(), measureTools_.end(), measureTool) | 181 ORTHANC_ASSERT(std::find(measureTools_.begin(), measureTools_.end(), measureTool) |
217 double ViewportController::GetAngleTopTextLabelDistanceS() const | 221 double ViewportController::GetAngleTopTextLabelDistanceS() const |
218 { | 222 { |
219 return TEXT_CENTER_DISTANCE_CANVAS_COORD * GetCanvasToSceneFactor(); | 223 return TEXT_CENTER_DISTANCE_CANVAS_COORD * GetCanvasToSceneFactor(); |
220 } | 224 } |
221 } | 225 } |
222 |