Fix #121354: GPv3: object mode selection outline too big

This was caused by c2504eb779.
The commit changed the factor for the radii, but didn't update the
overlay code for the outlines.

This fix makes sure we're using the right conversion factor.
This commit is contained in:
Falk David
2024-05-02 16:31:05 +02:00
parent d4fc167db1
commit 370712fc1b

View File

@@ -295,13 +295,10 @@ static void OVERLAY_outline_grease_pencil(OVERLAY_PrivateData *pd, Scene *scene,
int t_offset = 0;
const Vector<DrawingInfo> drawings = retrieve_visible_drawings(*scene, grease_pencil, true);
for (const DrawingInfo info : drawings) {
const bool is_screenspace = false;
const bool is_stroke_order_3d = (grease_pencil.flag & GREASE_PENCIL_STROKE_ORDER_3D) != 0;
float object_scale = mat4_to_scale(ob->object_to_world().ptr());
/* Negate thickness sign to tag that strokes are in screen space.
* Convert to world units (by default, 1 meter = 1000 pixels). */
float thickness_scale = (is_screenspace) ? -1.0f : 1.0f / 1000.0f;
const float object_scale = mat4_to_scale(ob->object_to_world().ptr());
const float thickness_scale = bke::greasepencil::LEGACY_RADIUS_CONVERSION_FACTOR;
gpu::VertBuf *position_tx = draw::DRW_cache_grease_pencil_position_buffer_get(scene, ob);
gpu::VertBuf *color_tx = draw::DRW_cache_grease_pencil_color_buffer_get(scene, ob);