Fix #141550: Pad Editor Outline to Avoid Blurriness

At low scale and on regular DPI displays the editor outline, being just
a single pixel can sometimes look blurry. Padding by half a pixel (that
is not increased with scale, DPI, or line size) avoids this blurriness.

Pull Request: https://projects.blender.org/blender/blender/pulls/142777
This commit is contained in:
Harley Acheson
2025-07-22 01:31:41 +02:00
committed by Harley Acheson
parent b0bf71cadf
commit 2ae08d3cbe

View File

@@ -199,11 +199,14 @@ void ED_screen_draw_edges(wmWindow *win)
float outline1[4];
float outline2[4];
rctf bounds;
/* Outset by 1/2 pixel, regardless of UI scale or pixel size. #141550. */
const float padding = 0.5f;
UI_GetThemeColor4fv(TH_EDITOR_OUTLINE, outline1);
UI_GetThemeColor4fv(TH_EDITOR_OUTLINE_ACTIVE, outline2);
UI_draw_roundbox_corner_set(UI_CNR_ALL);
LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
BLI_rctf_rcti_copy(&bounds, &area->totrct);
BLI_rctf_pad(&bounds, padding, padding);
UI_draw_roundbox_4fv_ex(&bounds,
nullptr,
nullptr,