From 7e21f1168aa30defa51f88b4f921aa0b0b7bd708 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 15 Sep 2023 17:36:18 +0200 Subject: editor: try fix light label color display --- editor/imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editor/imgui.cpp b/editor/imgui.cpp index 3c483265..ab6d837a 100644 --- a/editor/imgui.cpp +++ b/editor/imgui.cpp @@ -182,7 +182,7 @@ void app::draw_light_info() char buf[128]; - if (e.falloff == light_falloff::constant) + if (e.falloff == light_falloff::constant || e.max_distance < 1e-6f) snformat(buf, "{}"_cf, falloff); else snformat(buf, "{} range={}"_cf, falloff, e.max_distance); @@ -200,7 +200,7 @@ void app::draw_light_info() ImGui::ColorConvertFloat4ToU32({0, 0, 0, 1})); draw.AddText({offx, offy}, ImGui::ColorConvertFloat4ToU32({1, 1, 0, 1}), buf); draw.AddRectFilled({offx-pad.x - 5 * dpi.x(), offy-pad.y + color_pad_y}, - {offx-pad.x + 0 * dpi.x(), offy-pad.y + text_size.y - color_pad_y}, + {offx-pad.x + 0 * dpi.x(), offy-pad.y + text_size.y - color_pad_y + 1}, ImGui::ColorConvertFloat4ToU32({color.x(), color.y(), color.z(), 1})); } } -- cgit v1.2.3