comparison Framework/Scene2D/Internals/FixedPointAligner.cpp @ 1331:ab81ee8fce1f broker

- Viewport is not passed and stored as a shared_ptr instead of raw reference. - ViewportController can now be injected with an undo stack (not a ctor param anymore, as a preparation for the move of the undo stack to an interactor) - Added (temp) flag to disable emscripten events registration in the WebAssemblyViewport (because legacy client code deals with them directly) - Added emscripten_clear_timeout in ~WebGLViewportsRegistry - Removed GenericToolbox::HoldingRef whose responsibility is better served with proper callback un-registration.
author Benjamin Golinvaux <bgo@osimis.io>
date Mon, 30 Mar 2020 14:23:46 +0200
parents a5326ce4f24b
children
comparison
equal deleted inserted replaced
1329:8d3e669f01a2 1331:ab81ee8fce1f
23 23
24 namespace OrthancStone 24 namespace OrthancStone
25 { 25 {
26 namespace Internals 26 namespace Internals
27 { 27 {
28 FixedPointAligner::FixedPointAligner(IViewport& viewport, 28 FixedPointAligner::FixedPointAligner(boost::shared_ptr<IViewport> viewport,
29 const ScenePoint2D& p) 29 const ScenePoint2D& p)
30 : viewport_(viewport) 30 : viewport_(viewport)
31 , canvas_(p) 31 , canvas_(p)
32 { 32 {
33 std::unique_ptr<IViewport::ILock> lock(viewport_.Lock()); 33 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock());
34 pivot_ = canvas_.Apply(lock->GetController().GetCanvasToSceneTransform()); 34 pivot_ = canvas_.Apply(lock->GetController().GetCanvasToSceneTransform());
35 } 35 }
36 36
37 37
38 void FixedPointAligner::Apply() 38 void FixedPointAligner::Apply()
39 { 39 {
40 std::unique_ptr<IViewport::ILock> lock(viewport_.Lock()); 40 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock());
41 ScenePoint2D p = canvas_.Apply( 41 ScenePoint2D p = canvas_.Apply(
42 lock->GetController().GetCanvasToSceneTransform()); 42 lock->GetController().GetCanvasToSceneTransform());
43 43
44 lock->GetController().SetSceneToCanvasTransform( 44 lock->GetController().SetSceneToCanvasTransform(
45 AffineTransform2D::Combine( 45 AffineTransform2D::Combine(