Image Editor: Smooth Wire User Preferences

The old image editor has an option to enable the smooth wire drawing.
This option was stored per editor and disabled by default. This patch
connects the smooth wires in the UV/Image editor to `User Prefereces ->
Viewport -> Quality -> Smooth Wire [] Overlay`.

The old option is left in place and will be removed when the old image
editor drawing code will be removed before BCon 3.
This commit is contained in:
Jeroen Bakker 2020-09-11 09:08:11 +02:00
parent 4212b6528a
commit b2fc067854
2 changed files with 5 additions and 3 deletions

View File

@ -1019,7 +1019,8 @@ class IMAGE_PT_view_display_uv_edit_overlays(Panel):
col.prop(uvedit, "show_faces", text="Faces")
col = layout.column()
col.prop(uvedit, "show_smooth_edges", text="Smooth")
if context.preferences.experimental.use_image_editor_legacy_drawing:
col.prop(uvedit, "show_smooth_edges", text="Smooth")
col.prop(uvedit, "show_modified_edges", text="Modified")
col.prop(uvedit, "uv_opacity")

View File

@ -112,7 +112,7 @@ void OVERLAY_edit_uv_init(OVERLAY_Data *vedata)
pd->edit_uv.dash_length = 4.0f * UI_DPI_FAC;
pd->edit_uv.line_style = edit_uv_line_style_from_space_image(sima);
pd->edit_uv.do_smooth_wire = (sima->flag & SI_SMOOTH_UV) != 0;
pd->edit_uv.do_smooth_wire = ((U.gpu_flag & USER_GPU_FLAG_OVERLAY_SMOOTH_WIRE) > 0);
pd->edit_uv.draw_type = sima->dt_uvstretch;
BLI_listbase_clear(&pd->edit_uv.totals);
@ -144,7 +144,8 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata)
pd->edit_uv_shadow_edges_grp, "alpha", pd->edit_uv.uv_opacity);
DRW_shgroup_uniform_float(
pd->edit_uv_shadow_edges_grp, "dashLength", &pd->edit_uv.dash_length, 1);
DRW_shgroup_uniform_bool_copy(pd->edit_uv_shadow_edges_grp, "doSmoothWire", true);
DRW_shgroup_uniform_bool(
pd->edit_uv_shadow_edges_grp, "doSmoothWire", &pd->edit_uv.do_smooth_wire, 1);
}
if (pd->edit_uv.do_uv_overlay) {