forked from organicmaps/organicmaps
switch off ruler on drag
This commit is contained in:
parent
29e2e6e262
commit
7949f35ef5
3 changed files with 11 additions and 1 deletions
|
@ -779,7 +779,7 @@ void Framework::DrawAdditionalInfo(shared_ptr<PaintEvent> const & e)
|
|||
|
||||
m_informationDisplay.setDebugInfo(0, GetDrawScale());
|
||||
|
||||
m_informationDisplay.enableRuler(m_navigator.InAction());
|
||||
m_informationDisplay.enableRuler(m_navigator.InAction() && !m_navigator.InDrag());
|
||||
#ifdef DEBUG
|
||||
m_informationDisplay.enableDebugInfo(true);
|
||||
#endif
|
||||
|
|
|
@ -29,6 +29,7 @@ namespace
|
|||
Navigator::Navigator(ScalesProcessor const & scales)
|
||||
: m_scales(scales),
|
||||
m_InAction(false),
|
||||
m_InDrag(false),
|
||||
m_DoSupportRotation(false)
|
||||
{
|
||||
}
|
||||
|
@ -337,6 +338,7 @@ void Navigator::StartDrag(m2::PointD const & pt, double /*timeInSec*/)
|
|||
m_StartPt1 = m_LastPt1 = pt;
|
||||
m_StartScreen = m_Screen;
|
||||
m_InAction = true;
|
||||
m_InDrag = true;
|
||||
}
|
||||
|
||||
void Navigator::DoDrag(m2::PointD const & pt, double /*timeInSec*/)
|
||||
|
@ -375,6 +377,7 @@ void Navigator::StopDrag(m2::PointD const & pt, double timeInSec, bool /*animate
|
|||
{
|
||||
DoDrag(pt, timeInSec);
|
||||
m_InAction = false;
|
||||
m_InDrag = false;
|
||||
}
|
||||
|
||||
bool Navigator::InAction() const
|
||||
|
@ -382,6 +385,11 @@ bool Navigator::InAction() const
|
|||
return m_InAction;
|
||||
}
|
||||
|
||||
bool Navigator::InDrag() const
|
||||
{
|
||||
return m_InDrag;
|
||||
}
|
||||
|
||||
void Navigator::StartScale(m2::PointD const & pt1, m2::PointD const & pt2, double /*timeInSec*/)
|
||||
{
|
||||
m_StartScreen = m_Screen;
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
bool Update(double timeInSec);
|
||||
|
||||
bool InAction() const;
|
||||
bool InDrag() const;
|
||||
|
||||
/// enabling/disabling screen rotation handling
|
||||
void SetSupportRotation(bool flag);
|
||||
|
@ -108,6 +109,7 @@ private:
|
|||
math::Matrix<float, 3, 3> m_DeltaMatrix;
|
||||
// Flag, which indicates, whether we are in the middle of some action.
|
||||
bool m_InAction;
|
||||
bool m_InDrag;
|
||||
// Does Navigator supports screen rotation.
|
||||
bool m_DoSupportRotation;
|
||||
// Should we check for threshold while scaling by two fingers.
|
||||
|
|
Loading…
Add table
Reference in a new issue