From 6761ca67714d6b098991110fee90b62e7a74a233 Mon Sep 17 00:00:00 2001 From: luboslenco Date: Thu, 21 May 2026 11:06:58 +0200 Subject: [PATCH] paint: fix mesh preview size --- paint/sources/tab_meshes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paint/sources/tab_meshes.c b/paint/sources/tab_meshes.c index 5d171f50..621bdeb3 100644 --- a/paint/sources/tab_meshes.c +++ b/paint/sources/tab_meshes.c @@ -458,9 +458,9 @@ void tab_meshes_make_preview(mesh_object_t *o) { quat_t saved_rot = o->base->transform->rot; { vec4_t aabb = mesh_data_calculate_aabb(o->data); - f32 r = math_sqrt(aabb.x * aabb.x + aabb.y * aabb.y + aabb.z * aabb.z); - f32 s = 1.0 / r; - if (o->base->parent == NULL) { + f32 r = math_max(aabb.x, math_max(aabb.y, aabb.z)); + f32 s = 0.5 / r; + if (o->base->parent == NULL || o->base->parent == _scene_scene_parent) { s *= o->base->transform->scale.x; } s *= o->data->scale_pos;