MCPcopy Create free account
hub / github.com/comaps/comaps / Update

Method Update

libs/drape_frontend/gui/ruler.cpp:66–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 {}
65
66 bool Update(ScreenBase const & screen)
67 {
68 RulerHelper & helper = DrapeGui::GetRulerHelper();
69
70 TBase::SetIsVisible(true);
71 bool isVisible = RulerHelper::IsVisible(screen);
72 if (!isVisible)
73 {
74 m_animation.HideAnimated();
75 m_isVisibleAtEnd = false;
76 }
77 else if (helper.IsTextDirty())
78 {
79 m_isAppearing = !m_isAppearing;
80 if (m_isAppearing)
81 {
82 m_animation.ShowAnimated();
83 m_isVisibleAtEnd = true;
84 }
85 else
86 {
87 m_animation.HideAnimated();
88 m_isVisibleAtEnd = false;
89 }
90 }
91
92 bool const result = TBase::Update(screen);
93 UpdateImpl(screen, helper);
94
95 if (m_animation.IsFinished())
96 TBase::SetIsVisible(m_isVisibleAtEnd);
97
98 return result;
99 }
100
101protected:
102 virtual void UpdateImpl(ScreenBase const & /*screen*/, RulerHelper const & /*helper*/) {}

Callers

nothing calls this directly

Calls 5

HideAnimatedMethod · 0.80
IsTextDirtyMethod · 0.80
ShowAnimatedMethod · 0.80
UpdateFunction · 0.50
IsFinishedMethod · 0.45

Tested by

no test coverage detected