From cdd74503ebb3819d8daf361fa9ea37b5176db0dd Mon Sep 17 00:00:00 2001 From: Victor Zarubkin Date: Thu, 11 Aug 2016 23:48:29 +0300 Subject: [PATCH] (ProfGraphicsScrollbar) overflow guard (it seems that this is because of floating point precision) --- profiler_gui/graphics_scrollbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiler_gui/graphics_scrollbar.cpp b/profiler_gui/graphics_scrollbar.cpp index 50cf785..89bb732 100644 --- a/profiler_gui/graphics_scrollbar.cpp +++ b/profiler_gui/graphics_scrollbar.cpp @@ -185,7 +185,7 @@ void ProfMinimapItem::paint(QPainter* _painter, const QStyleOptionGraphicsItem* // Draw rectangle const auto h = ::std::max((item.width() - m_minDuration) * coeff, 5.0); - const auto col = h * heightRevert; + const auto col = ::std::min(h * heightRevert, 0.9999999); //const auto color = ::profiler_gui::toRgb(col * 255, (1.0 - col) * 255, 0); // item.color; const auto color = 0x00ffffff & QColor::fromHsvF((1.0 - col) * 0.35, 0.85, 0.85).rgb();