forked from 1b-agent/opencadstudio-upstream
Dynamic dimensions: reference text format, horizontal text, lock after the text
A plain number shows as typed (d1=100), an expression under the fx: prefix (fx: d2=d1*2); the text stays horizontal through DIMTIH/DIMTOH overrides and the lock mark follows the text. Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
1 parent
0b5c686371
commit
aa51765a62
3 files changed
+52
-25
No files matched your search
@@ -6295,8 +6295,8 @@ fn dimension_text_is_outside(dim: &Dimension, style: Option<&DimStyle>) -> bool
|
||||
}
|
||||
}
|
||||
|
||||
/// Where a dynamic dimension's lock mark sits: just before the text on its
|
||||
/// baseline, with the direction that points away from the text.
|
||||
/// Where a dynamic dimension's lock mark sits: just after the (horizontal)
|
||||
/// text, with the direction that points away from the text.
|
||||
pub(crate) fn dynamic_dimension_lock_anchor(
|
||||
document: &CadDocument,
|
||||
dim: &Dimension,
|
||||
@@ -6317,13 +6317,7 @@ pub(crate) fn dynamic_dimension_lock_anchor(
|
||||
let stack_scale = style.map(dimtfac_or_one).unwrap_or(1.0);
|
||||
let half_width = text_cells(&value, stack_scale) * text_height * CELL_WIDTH * 0.5;
|
||||
let pos = dimension_text_pos_f64(dim, style, text_height, dim_scale);
|
||||
let rot = if dim.base().text_rotation.abs() > 1e-9 {
|
||||
dim.base().text_rotation
|
||||
} else {
|
||||
dimension_text_natural_rotation(dim)
|
||||
};
|
||||
let (sr, cr) = rot.sin_cos();
|
||||
let outward = Vector3::new(-cr, -sr, 0.0);
|
||||
let outward = Vector3::new(1.0, 0.0, 0.0);
|
||||
Some((
|
||||
Vector3::new(
|
||||
pos.x + outward.x * half_width,
|
||||
|
||||
Reference in new issue
Block a user