diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.cc b/source/blender/draw/engines/gpencil/gpencil_cache_utils.cc index 019c0f1fb8e..4fb0c19f84f 100644 --- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.cc +++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.cc @@ -68,7 +68,7 @@ GPENCIL_tObject *gpencil_object_cache_add(GPENCIL_PrivateData *pd, Object *ob) * computationally heavy and should go into the GPData evaluation. */ const std::optional> bounds = BKE_gpencil_data_minmax(gpd).value_or( Bounds(float3(0))); - float3 size = bounds->max - bounds->min; + float3 size = (bounds->max - bounds->min) * 0.5f; float3 center = math::midpoint(bounds->min, bounds->max); /* Convert bbox to matrix */ float mat[4][4]; diff --git a/source/blender/draw/engines/overlay/overlay_extra.cc b/source/blender/draw/engines/overlay/overlay_extra.cc index d067d71a708..28dc97323fd 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.cc +++ b/source/blender/draw/engines/overlay/overlay_extra.cc @@ -366,7 +366,7 @@ static void OVERLAY_bounds(OVERLAY_ExtraCallBuffers *cb, const Bounds bounds = BKE_object_boundbox_get(ob).value_or( Bounds(float3(-1.0f), float3(1.0f))); - float3 size = bounds.max - bounds.min; + float3 size = (bounds.max - bounds.min) * 0.5f; const float3 center = around_origin ? float3(0) : math::midpoint(bounds.min, bounds.max); switch (boundtype) { diff --git a/source/blender/draw/engines/overlay/overlay_outline.cc b/source/blender/draw/engines/overlay/overlay_outline.cc index 92b2588e017..5c78e19e832 100644 --- a/source/blender/draw/engines/overlay/overlay_outline.cc +++ b/source/blender/draw/engines/overlay/overlay_outline.cc @@ -38,7 +38,7 @@ static void gpencil_depth_plane(Object *ob, float r_plane[4]) * computationally heavy and should go into the GPData evaluation. */ const std::optional> bounds = BKE_object_boundbox_get(ob).value_or( Bounds(float3(0))); - float3 size = bounds->max - bounds->min; + float3 size = (bounds->max - bounds->min) * 0.5f; float3 center = math::midpoint(bounds->min, bounds->max); /* Convert bbox to matrix */ float mat[4][4];