fix(mleader): text left of its landing attaches by its right edge

The text was placed by its alignment rather than its attachment point,
so text on the left of the landing ran over the leader. It now attaches
by the attachment point, and putting the text on a side (on creation or
by a grip) turns left- or right-justified text to read away from the
leader.

Fixes #1646

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-08 08:34:49 +03:00
1 parent f4c0dc451d
commit da2704bb45
2 files changed
+26 -15

No files matched your search

+1 -6
View File
@@ -693,12 +693,7 @@ fn build_mleader(
let to_right = (elbow_pt - arrow_pt).dot(ux.as_dvec3()) >= 0.0;
let sign = if to_right { 1.0 } else { -1.0 };
let landing = ux * (sign as f32);
ml.context.text_attachment_point =
if to_right {
codec::entities::multileader::TextAttachmentPointType::Left
} else {
codec::entities::multileader::TextAttachmentPointType::Right
};
crate::entities::multileader::set_mleader_text_side(&mut ml, to_right);
ml.context.text_rotation = (ux.y as f64).atan2(ux.x as f64);
ml.context.text_direction = Vector3::new(ux.x as f64, ux.y as f64, 0.0);