Mercurial > hg > orthanc-stone
comparison Framework/Scene2D/Internals/FixedPointAligner.cpp @ 617:7efa2543699d
simplification
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 02 May 2019 18:21:59 +0200 |
parents | b716763571ad |
children | 059e1fd05fd6 |
comparison
equal
deleted
inserted
replaced
616:97926984d5d0 | 617:7efa2543699d |
---|---|
24 namespace OrthancStone | 24 namespace OrthancStone |
25 { | 25 { |
26 namespace Internals | 26 namespace Internals |
27 { | 27 { |
28 FixedPointAligner::FixedPointAligner(Scene2D& scene, | 28 FixedPointAligner::FixedPointAligner(Scene2D& scene, |
29 const ScenePoint2D& p, | 29 const ScenePoint2D& p) : |
30 unsigned int canvasWidth, | 30 scene_(scene), |
31 unsigned int canvasHeight) : | 31 canvas_(p) |
32 scene_(scene) | |
33 { | 32 { |
34 canvas_ = ScenePoint2D(p.GetX() - static_cast<double>(canvasWidth) / 2.0, | |
35 p.GetY() - static_cast<double>(canvasHeight) / 2.0); | |
36 pivot_ = canvas_.Apply(scene_.GetCanvasToSceneTransform()); | 33 pivot_ = canvas_.Apply(scene_.GetCanvasToSceneTransform()); |
37 } | 34 } |
38 | 35 |
39 | 36 |
40 void FixedPointAligner::Apply() | 37 void FixedPointAligner::Apply() |