fix(properties): sync polyline segment widths with global width and display varies when differing

This commit is contained in:
Karim Jerbi committed 2026-09-10 12:30:33 +01:00
1 parent 4d3b8d8b79
commit 6ca16738f0
4 files changed
+349 -49

No files matched your search

+10 -20
View File
@@ -215,17 +215,12 @@ fn polyline_segment_widths(entity: &EntityType) -> Vec<(f32, f32)> {
(0..seg_count)
.map(|i| {
let v = &p.vertices[i];
let sw = if v.start_width > 1e-9 {
v.start_width
let (sw, ew) = if v.start_width > 1e-9 || v.end_width > 1e-9 {
(v.start_width, v.end_width)
} else {
c
} as f32;
let ew = if v.end_width > 1e-9 {
v.end_width
} else {
c
} as f32;
(sw, ew)
(c, c)
};
(sw as f32, ew as f32)
})
.collect()
}
@@ -244,17 +239,12 @@ fn polyline_segment_widths(entity: &EntityType) -> Vec<(f32, f32)> {
(0..seg_count)
.map(|i| {
let v = &verts[i];
let sw = if v.start_width > 1e-9 {
v.start_width
let (sw, ew) = if v.start_width > 1e-9 || v.end_width > 1e-9 {
(v.start_width, v.end_width)
} else {
def_start
} as f32;
let ew = if v.end_width > 1e-9 {
v.end_width
} else {
def_end
} as f32;
(sw, ew)
(def_start, def_end)
};
(sw as f32, ew as f32)
})
.collect()
}