Merge pull request #3296 from rokuz/fixed-gui-on-update-map-style

Fixed embedded GUI on updating map style
This commit is contained in:
Daria Volvenkova 2016-05-24 14:22:54 +04:00
commit 035eb199ce
7 changed files with 24 additions and 5 deletions

View file

@ -37,8 +37,8 @@ private:
double m_endT;
};
ShowHideAnimation::ShowHideAnimation(bool isInitialiVisible, double fullDuraction)
: m_state(isInitialiVisible ? STATE_VISIBLE : STATE_INVISIBLE)
ShowHideAnimation::ShowHideAnimation(bool isInitialVisible, double fullDuraction)
: m_state(isInitialVisible ? STATE_VISIBLE : STATE_INVISIBLE)
, m_fullDuration(fullDuraction)
{
}

View file

@ -18,7 +18,7 @@ public:
STATE_HIDE_DIRECTION
};
ShowHideAnimation(bool isInitialiVisible, double fullDuraction);
ShowHideAnimation(bool isInitialVisible, double fullDuraction);
~ShowHideAnimation();
void Show();

View file

@ -1,5 +1,6 @@
#include "drape_frontend/animation/interpolation_holder.hpp"
#include "drape_frontend/gui/drape_gui.hpp"
#include "drape_frontend/gui/ruler_helper.hpp"
#include "drape_frontend/animation_system.hpp"
#include "drape_frontend/framebuffer.hpp"
#include "drape_frontend/frontend_renderer.hpp"
@ -359,6 +360,9 @@ void FrontendRenderer::AcceptMessage(ref_ptr<Message> message)
UpdateDisplacementEnabled();
InvalidateRect(screen.ClipRect());
}
if (m_guiRenderer->HasWidget(gui::WIDGET_RULER))
gui::DrapeGui::GetRulerHelper().Invalidate();
break;
}

View file

@ -38,6 +38,12 @@ namespace
if (!TBase::Update(screen))
return false;
if (!DrapeGui::Instance().IsCopyrightActive())
{
SetIsVisible(false);
return false;
}
if (m_animation == nullptr)
m_animation.reset(new df::OpacityAnimation(kCopyrightHideTime, kCopyrightVisibleTime, 1.0f, 0.0f));

View file

@ -32,8 +32,11 @@ void LayerRenderer::Build(ref_ptr<dp::GpuProgramManager> mng)
void LayerRenderer::Render(ref_ptr<dp::GpuProgramManager> mng, ScreenBase const & screen)
{
DrapeGui::GetRulerHelper().ResetTextDirtyFlag();
DrapeGui::GetRulerHelper().Update(screen);
if (HasWidget(gui::WIDGET_RULER))
{
DrapeGui::GetRulerHelper().ResetTextDirtyFlag();
DrapeGui::GetRulerHelper().Update(screen);
}
for (TRenderers::value_type & r : m_renderers)
r.second->Render(screen, mng);
}

View file

@ -153,6 +153,11 @@ bool RulerHelper::IsVisible(ScreenBase const & screen) const
return !gui.IsCopyrightActive() && df::GetDrawTileScale(screen) >= VISIBLE_RULER_BOTTOM_SCALE;
}
void RulerHelper::Invalidate()
{
SetTextDirty();
}
float RulerHelper::GetRulerHalfHeight() const
{
float const kRulerHalfHeight = 1.0f;

View file

@ -16,6 +16,7 @@ public:
void Update(ScreenBase const & screen);
bool IsVisible(ScreenBase const & screen) const;
void Invalidate();
float GetRulerHalfHeight() const;
float GetRulerPixelLength() const;