fix(bar): 绘制 cell 文本前校验其文本避免渲染空内容

This commit is contained in:
2026-06-16 17:22:52 +08:00
parent 6e3e7ee937
commit 9bbdb26f06

View File

@@ -309,7 +309,7 @@ static void bar_item_draw(
.width = cell_area.width - item->cell_padding * 2,
.height = height,
};
if (text_area.width > 0) {
if (text_area.width > 0 && cell->text && cell->text[0] != '\0') {
draw_text(cr, ctx, cell->text, &cell->fg, text_area);
}