Mercurial > hg > orthanc-stone
comparison Framework/Scene2DViewport/MeasureTrackers.cpp @ 1501:1e381f2596d3
fix warnings
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 30 Jun 2020 11:29:41 +0200 |
parents | 30deba7bc8e2 |
children |
comparison
equal
deleted
inserted
replaced
1500:6e832ff72a5e | 1501:1e381f2596d3 |
---|---|
47 // if the tracker completes successfully, we add the command | 47 // if the tracker completes successfully, we add the command |
48 // to the undo stack | 48 // to the undo stack |
49 // otherwise, we simply undo it | 49 // otherwise, we simply undo it |
50 | 50 |
51 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); | 51 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
52 ViewportController& controller = lock->GetController(); | |
53 | 52 |
54 if (commitResult_) | 53 if (commitResult_) |
55 lock->GetController().PushCommand(command_); | 54 lock->GetController().PushCommand(command_); |
56 else | 55 else |
57 command_->Undo(); | 56 command_->Undo(); |
63 : viewport_(viewport) | 62 : viewport_(viewport) |
64 , alive_(true) | 63 , alive_(true) |
65 , commitResult_(true) | 64 , commitResult_(true) |
66 { | 65 { |
67 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); | 66 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
68 ViewportController& controller = lock->GetController(); | |
69 | 67 |
70 originalClickPosition_ = e.GetMainPosition().Apply( | 68 originalClickPosition_ = e.GetMainPosition().Apply( |
71 controller.GetScene().GetCanvasToSceneTransform()); | 69 lock->GetController().GetScene().GetCanvasToSceneTransform()); |
72 } | 70 } |
73 | 71 |
74 void EditMeasureTracker::Cancel() | 72 void EditMeasureTracker::Cancel() |
75 { | 73 { |
76 commitResult_ = false; | 74 commitResult_ = false; |
87 // if the tracker completes successfully, we add the command | 85 // if the tracker completes successfully, we add the command |
88 // to the undo stack | 86 // to the undo stack |
89 // otherwise, we simply undo it | 87 // otherwise, we simply undo it |
90 | 88 |
91 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); | 89 std::unique_ptr<IViewport::ILock> lock(viewport_->Lock()); |
92 ViewportController& controller = lock->GetController(); | |
93 | 90 |
94 if (commitResult_) | 91 if (commitResult_) |
95 lock->GetController().PushCommand(command_); | 92 lock->GetController().PushCommand(command_); |
96 else | 93 else |
97 command_->Undo(); | 94 command_->Undo(); |