From 755f33186a9ee2a4231d2eab0d0aab8643e7a9e4 Mon Sep 17 00:00:00 2001 From: Aaron Muir Hamilton Date: Wed, 16 Apr 2025 23:12:31 -0400 Subject: [PATCH] tabulon_dxf: use block base point for inserts inside block defs. --- tabulon_dxf/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tabulon_dxf/src/lib.rs b/tabulon_dxf/src/lib.rs index 7516361..751ba6b 100644 --- a/tabulon_dxf/src/lib.rs +++ b/tabulon_dxf/src/lib.rs @@ -673,6 +673,8 @@ pub fn load_file_default_layers(path: impl AsRef) -> DxfResult (line_weight, color) }; + let base_point = point_from_dxf_point(&b.base_point); + let mut cur_style = resolve_style( handle_for_layer_name[b.entities[0].common.layer.as_str()], b.entities[0].common.lineweight_enum_value, @@ -709,7 +711,8 @@ pub fn load_file_default_layers(path: impl AsRef) -> DxfResult ins.x_scale_factor, ins.y_scale_factor, ); - let location = point_from_dxf_point(&ins.location); + let location = + point_from_dxf_point(&ins.location) - base_point.to_vec2(); if !lines.is_empty() { // Always push a chunk before an insert if not empty.