DrawList: changed CenterPixelAligned growth to be smoother, added stroke pos to AddLine()

- changed vertical AddLine() to be consistent with AddLineV()
- changed CenterPixelAligned growth to be smoother
- added (temporary) specialized stroke pos support for AddLine()
This commit is contained in:
Mikko Mononen
2026-05-19 23:13:33 +03:00
committed by ocornut
parent 753cb8474d
commit 19e80b58b0
2 changed files with 41 additions and 10 deletions

View File

@@ -10469,7 +10469,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
draw_list->AddLineV(x, y, y + sz, col, th, flags); x += spacing; // Vertical line (note: drawing a filled rectangle will be faster!)
draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y), col, th, flags); x += sz + spacing;
draw_list->AddLine(ImVec2(x, y), ImVec2(x, y + sz), col, th, flags); x += spacing;
draw_list->AddLine(ImVec2(x, y + sz), ImVec2(x, y), col, th, flags); x += spacing;
draw_list->AddLine(ImVec2(x, y), ImVec2(x + sz, y + sz), col, th, flags); x += sz + spacing; // Diagonal line