Fix T89587: Don't Change Line Width For Previews

Do not temporarily change U.pixelsize while creating object previews
in object_preview_render. It does nothing to the render, but the change
in line width can affect other UI drawing since it is done in a thread.

see D13717 for for details.

Differential Revision: https://developer.blender.org/D13717

Reviewed by Julian Eisel
This commit is contained in:
Harley Acheson 2022-01-04 15:51:18 -08:00
parent e3748d7fa5
commit 713d59bcaf
Notes: blender-bot 2023-02-14 09:17:57 +01:00
Referenced by issue #96002, Menu/Outliner text funkyness
Referenced by issue #95221, Eevee: Float Curve node causes issues with compiled shader
Referenced by issue #93979, Knife tool issue : create duplicate vertex  unexpectedly.
Referenced by issue #89587, Marking objects as assets makes the top bar disappear
1 changed files with 0 additions and 5 deletions

View File

@ -848,7 +848,6 @@ static Scene *object_preview_scene_create(const struct ObjectPreviewData *previe
static void object_preview_render(IconPreview *preview, IconPreviewSize *preview_sized)
{
Main *preview_main = BKE_main_new();
const float pixelsize_old = U.pixelsize;
char err_out[256] = "unknown";
BLI_assert(preview->id_copy && (preview->id_copy != preview->id));
@ -867,8 +866,6 @@ static void object_preview_render(IconPreview *preview, IconPreviewSize *preview
/* Ownership is now ours. */
preview->id_copy = nullptr;
U.pixelsize = 2.0f;
View3DShading shading;
BKE_screen_view3d_shading_init(&shading);
/* Enable shadows, makes it a bit easier to see the shape. */
@ -890,8 +887,6 @@ static void object_preview_render(IconPreview *preview, IconPreviewSize *preview
err_out);
/* TODO: color-management? */
U.pixelsize = pixelsize_old;
if (ibuf) {
icon_copy_rect(ibuf, preview_sized->sizex, preview_sized->sizey, preview_sized->rect);
IMB_freeImBuf(ibuf);