UI: Added Edge Width option in preferences for 3DView and UV/Image Editor #104741

Merged
Clément Foucault merged 4 commits from Xylvier/blender:xylvier-edge-width-patch into main 2023-02-27 20:02:49 +01:00
1 changed files with 1 additions and 2 deletions
Showing only changes of commit 2655d5546b - Show all commits

View File

@ -175,8 +175,7 @@ void DRW_globals_update(void)
max_ff(1.0f, UI_GetThemeValuef(TH_VERTEX_SIZE) * (float)M_SQRT2 / 2.0f);
gb->size_vertex_gpencil = U.pixelsize * UI_GetThemeValuef(TH_GP_VERTEX_SIZE);
gb->size_face_dot = U.pixelsize * UI_GetThemeValuef(TH_FACEDOT_SIZE);
gb->size_edge = U.pixelsize *
max_ff(0.5f, UI_GetThemeValuef(TH_EDGE_WIDTH) * (float)M_SQRT2 / 4.0f);
gb->size_edge = U.pixelsize * max_ff(1.0f, UI_GetThemeValuef(TH_EDGE_WIDTH)) / 2.0f;
gb->size_edge_fix = U.pixelsize * (0.5f + 2.0f * (1.0f * (gb->size_edge * (float)M_SQRT1_2)));
fclem marked this conversation as resolved

I don't understand this value. It looks like it was copied from gb->size_vertex. For point size it make sense because there was a square dot to circle dot surface conversion (from the 2.8 days).

To me, the right value should be:

U.pixelsize * max_ff(1.0f, UI_GetThemeValuef(TH_EDGE_WIDTH)) / 2.0f;
I don't understand this value. It looks like it was copied from `gb->size_vertex`. For point size it make sense because there was a square dot to circle dot surface conversion (from the 2.8 days). To me, the right value should be: ``` U.pixelsize * max_ff(1.0f, UI_GetThemeValuef(TH_EDGE_WIDTH)) / 2.0f;
gb->pixel_fac = *DRW_viewport_pixelsize_get();