chore(dimension): sync with main

This commit is contained in:
Hakan Seven committed 2026-08-28 19:01:59 +03:00
commit d991289a56
18 files changed
+2556 -1051

No files matched your search

-8
View File
@@ -89,14 +89,6 @@ pub fn general_section(entity: &EntityType) -> PropSection {
],
};
if matches!(entity, EntityType::Point(_)) {
let hyperlink = section.props.iter().position(|prop| prop.field == "hyperlink");
let transparency = section.props.iter().position(|prop| prop.field == "transparency");
if let (Some(hyperlink), Some(transparency)) = (hyperlink, transparency) {
section.props.swap(hyperlink, transparency);
}
}
// Thickness (DXF 39) is a General-group property, but only the entity
// types that carry an extrusion thickness expose it (line, circle, arc,
// polyline, text, 2D solid, …). Show it right after Hyperlink for those.
+2
View File
@@ -1535,6 +1535,8 @@ pub fn tessellate(
| EntityType::Circle(_)
| EntityType::Arc(_)
| EntityType::Ellipse(_)
| EntityType::Spline(_)
| EntityType::LwPolyline(_)
) {
(pattern_length, pattern)
} else {
+2 -4
View File
@@ -1420,10 +1420,8 @@ pub struct Scene {
pub selection: Rc<RefCell<SelectionState>>,
/// The CAD document — single source of truth for all entities.
pub document: CadDocument,
/// Last linear, aligned, angular, or ordinate dimension created during this
/// application session. This is intentionally not reconstructed from file
/// handles: continuation commands must not treat an old, merely high-handle
/// dimension loaded from disk as the user's most recently created dimension.
/// Last chain-compatible dimension created this session.
/// Never reconstructed from loaded file handles.
pub last_created_dimension: Option<Handle>,
/// File-open-prepared index for non-graphical semantic object lookups.
pub(crate) object_data_cache: crate::entities::object_data::ObjectDataCache,
+1 -1
View File
@@ -250,7 +250,7 @@ impl Scene {
let source_length = stationed.then(|| wire.pattern_stations[wire.points.len()]);
let (clipped, mut clipped_stations) = clip_polyline_to_rect(
&projected_pts,
stationed.then_some(&wire.pattern_stations[..wire.points.len()]),
stationed.then(|| &wire.pattern_stations[..wire.points.len()]),
vp_x0,
vp_y0,
vp_x1,
+9 -2
View File
@@ -3795,14 +3795,21 @@ impl Scene {
full_bounds,
self.document.header.lineweight_display || display_plot_lineweights,
);
if self.document.header.paper_space_linetype_scaling
// Model space: scale linetypes using the current annotation scale so their
// appearance can match a paper-space viewport at the same drawing scale.
if self.current_layout == "Model" {
if self.annotation_scale.is_finite() && self.annotation_scale > 1e-9 {
uniforms.linetype_scale = self.annotation_scale;
}
} else if self.document.header.paper_space_linetype_scaling
&& !inst.paper_sheet
&& inst.tile_idx.is_none()
&& inst.handle != Handle::NULL
{
if let Some(EntityType::Viewport(vp)) = self.document.get_entity(inst.handle) {
let viewport_scale =
vp_effective_scale(vp.custom_scale, vp.view_height, vp.height);
if viewport_scale.is_finite() && viewport_scale > 1e-9 {
uniforms.linetype_scale = (1.0 / viewport_scale) as f32;
}