Skip to content

Commit

Permalink
Don't double render label background.
Browse files Browse the repository at this point in the history
  • Loading branch information
Themaister committed Jun 20, 2024
1 parent 7037f83 commit a208466
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions ui/label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,6 @@ void Label::reconfigure_to_canvas(vec2, vec2)

float Label::render(FlatRenderer &renderer, float layer, vec2 offset, vec2 size)
{
if (bg_color.w > 0.0f)
{
if (bg_image)
{
auto *view = renderer.get_device().get_resource_manager().get_image_view_blocking(bg_image);
renderer.render_textured_quad(*view,
vec3(offset, layer), size,
vec2(0.0f), vec2(view->get_view_width(), view->get_view_height()),
DrawPipeline::AlphaBlend, bg_color, Vulkan::StockSampler::LinearClamp);
}
else
{
renderer.render_quad(vec3(offset, layer), size, bg_color);
}
}

auto &ui = *GRANITE_UI_MANAGER();
auto &font = ui.get_font(font_size);
renderer.render_text(font, text.c_str(), vec3(offset + geometry.margin, layer - 0.5f), size - 2.0f * geometry.margin,
Expand Down

0 comments on commit a208466

Please sign in to comment.