@@ -1299,9 +1299,9 @@ void ImGuiFullscreen::ResetMenuButtonFrame()
12991299
13001300void ImGuiFullscreen::RenderShadowedTextClipped (ImDrawList* draw_list, ImFont* font, const ImVec2& pos_min,
13011301 const ImVec2& pos_max, u32 color, const char * text,
1302- const char * text_end, const ImVec2* text_size_if_known /* = nullptr */ ,
1303- const ImVec2& align /* = ImVec2(0, 0) */ , float wrap_width /* = 0.0f */ ,
1304- const ImRect* clip_rect /* = nullptr */ )
1302+ const char * text_end, const ImVec2* text_size_if_known,
1303+ const ImVec2& align, float wrap_width, const ImRect* clip_rect ,
1304+ float shadow_offset )
13051305{
13061306 const char * text_display_end = ImGui::FindRenderedTextEnd (text, text_end);
13071307 const int text_len = (int )(text_display_end - text);
@@ -1328,22 +1328,36 @@ void ImGuiFullscreen::RenderShadowedTextClipped(ImDrawList* draw_list, ImFont* f
13281328 pos.y = ImMax (pos.y , pos.y + (pos_max.y - pos.y - text_size.y ) * align.y );
13291329
13301330 // Render
1331- const u32 shadow_color = (UIStyle.ShadowColor & ~IM_COL32_A_MASK) | (color & IM_COL32_A_MASK);
1331+ const u32 alpha = (color /* & IM_COL32_A_MASK*/ ) >> IM_COL32_A_SHIFT;
1332+ if (alpha == 0 )
1333+ return ;
1334+
1335+ const u32 shadow_color = MulAlpha (UIStyle.ShadowColor , alpha);
13321336 if (need_clipping)
13331337 {
13341338 ImVec4 fine_clip_rect (clip_min->x , clip_min->y , clip_max->x , clip_max->y );
1335- draw_list->AddText (font, font->FontSize , pos + LayoutScale (LAYOUT_SHADOW_OFFSET, LAYOUT_SHADOW_OFFSET) ,
1336- shadow_color, text, text_display_end, wrap_width, &fine_clip_rect);
1339+ draw_list->AddText (font, font->FontSize , ImVec2 ( pos. x + shadow_offset, pos. y + shadow_offset), shadow_color, text ,
1340+ text_display_end, wrap_width, &fine_clip_rect);
13371341 draw_list->AddText (font, font->FontSize , pos, color, text, text_display_end, wrap_width, &fine_clip_rect);
13381342 }
13391343 else
13401344 {
1341- draw_list->AddText (font, font->FontSize , pos + LayoutScale (LAYOUT_SHADOW_OFFSET, LAYOUT_SHADOW_OFFSET) ,
1342- shadow_color, text, text_display_end, wrap_width, nullptr );
1345+ draw_list->AddText (font, font->FontSize , ImVec2 ( pos. x + shadow_offset, pos. y + shadow_offset), shadow_color, text ,
1346+ text_display_end, wrap_width, nullptr );
13431347 draw_list->AddText (font, font->FontSize , pos, color, text, text_display_end, wrap_width, nullptr );
13441348 }
13451349}
13461350
1351+ void ImGuiFullscreen::RenderShadowedTextClipped (ImDrawList* draw_list, ImFont* font, const ImVec2& pos_min,
1352+ const ImVec2& pos_max, u32 color, const char * text,
1353+ const char * text_end, const ImVec2* text_size_if_known /* = nullptr */ ,
1354+ const ImVec2& align /* = ImVec2(0, 0)*/ , float wrap_width /* = 0.0f*/ ,
1355+ const ImRect* clip_rect /* = nullptr */ )
1356+ {
1357+ RenderShadowedTextClipped (draw_list, font, pos_min, pos_max, color, text, text_end, text_size_if_known, align,
1358+ wrap_width, clip_rect, LayoutScale (LAYOUT_SHADOW_OFFSET));
1359+ }
1360+
13471361void ImGuiFullscreen::RenderShadowedTextClipped (ImFont* font, const ImVec2& pos_min, const ImVec2& pos_max, u32 color,
13481362 const char * text, const char * text_end,
13491363 const ImVec2* text_size_if_known /* = nullptr */ ,
0 commit comments