From afb82822d04dd0f5f67aa221be1dfb0216d8a551 Mon Sep 17 00:00:00 2001 From: "r.kuznetsov" Date: Thu, 28 Dec 2017 18:59:54 +0300 Subject: [PATCH] Fixed crash in GetBgColor --- drape_frontend/frontend_renderer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drape_frontend/frontend_renderer.cpp b/drape_frontend/frontend_renderer.cpp index 54ffa4b688..47fa2a84fc 100755 --- a/drape_frontend/frontend_renderer.cpp +++ b/drape_frontend/frontend_renderer.cpp @@ -1494,8 +1494,10 @@ void FrontendRenderer::RefreshPivotTransform(ScreenBase const & screen) void FrontendRenderer::RefreshBgColor() { - uint32_t color = drule::rules().GetBgColor(df::GetDrawTileScale(m_userEventStream.GetCurrentScreen())); - dp::Color c = dp::Extract(color, 0 /*255 - (color >> 24)*/); + auto const scale = std::min(df::GetDrawTileScale(m_userEventStream.GetCurrentScreen()), + scales::GetUpperStyleScale()); + auto const color = drule::rules().GetBgColor(scale); + auto const c = dp::Extract(color, 0 /*255 - (color >> 24)*/); GLFunctions::glClearColor(c.GetRedF(), c.GetGreenF(), c.GetBlueF(), 1.0f); }