Mercurial > hg > orthanc-stone
diff Framework/Scene2DViewport/LineMeasureTool.cpp @ 891:0aff28f15ea2
new abstraction: IViewport
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 10 Jul 2019 18:18:42 +0200 |
parents | c71ef52602a0 |
children | 52b1c6ff10c5 |
line wrap: on
line diff
--- a/Framework/Scene2DViewport/LineMeasureTool.cpp Wed Jul 10 15:23:13 2019 +0200 +++ b/Framework/Scene2DViewport/LineMeasureTool.cpp Wed Jul 10 18:18:42 2019 +0200 @@ -97,7 +97,7 @@ LineMeasureTool::LineHighlightArea LineMeasureTool::LineHitTest(ScenePoint2D p) const { const double pixelToScene = - GetScene()->GetCanvasToSceneTransform().ComputeZoom(); + GetController()->GetScene().GetCanvasToSceneTransform().ComputeZoom(); const double SQUARED_HIT_TEST_MAX_DISTANCE_SCENE_COORD = pixelToScene * HIT_TEST_MAX_DISTANCE_CANVAS_COORD * pixelToScene * HIT_TEST_MAX_DISTANCE_CANVAS_COORD; const double sqDistanceFromStart = ScenePoint2D::SquaredDistancePtPt(p, start_); @@ -123,7 +123,7 @@ boost::shared_ptr<IFlexiblePointerTracker> LineMeasureTool::CreateEditionTracker(const PointerEvent& e) { ScenePoint2D scenePos = e.GetMainPosition().Apply( - GetScene()->GetCanvasToSceneTransform()); + GetController()->GetScene().GetCanvasToSceneTransform()); if (!HitTest(scenePos)) return boost::shared_ptr<IFlexiblePointerTracker>(); @@ -196,7 +196,7 @@ PolylineSceneLayer::Chain chain; //TODO: take DPI into account - AddSquare(chain, GetScene(), start_, + AddSquare(chain, GetController()->GetScene(), start_, GetController()->GetHandleSideLengthS()); if (lineHighlightArea_ == LineHighlightArea_Start) @@ -209,7 +209,7 @@ PolylineSceneLayer::Chain chain; //TODO: take DPI into account - AddSquare(chain, GetScene(), end_, + AddSquare(chain, GetController()->GetScene(), end_, GetController()->GetHandleSideLengthS()); if (lineHighlightArea_ == LineHighlightArea_End) @@ -235,7 +235,7 @@ double midY = 0.5 * (end_.GetY() + start_.GetY()); SetTextLayerOutlineProperties( - GetScene(), layerHolder_, buf, ScenePoint2D(midX, midY)); + GetController()->GetScene(), layerHolder_, buf, ScenePoint2D(midX, midY)); } } else