Fix linetype refresh and circle rendering
This commit is contained in:
parent
30b8974b73
commit
6752df6ea4
2 changed files with 12 additions and 3 deletions
|
|
@ -1887,6 +1887,8 @@ impl OpenCADStudio {
|
||||||
if v > 0.0 {
|
if v > 0.0 {
|
||||||
self.push_undo_snapshot(i, "LTSCALE");
|
self.push_undo_snapshot(i, "LTSCALE");
|
||||||
self.tabs[i].scene.document.header.linetype_scale = v;
|
self.tabs[i].scene.document.header.linetype_scale = v;
|
||||||
|
// LTSCALE affects the cached linetype geometry of the whole drawing.
|
||||||
|
self.tabs[i].scene.bump_geometry();
|
||||||
self.tabs[i].dirty = true;
|
self.tabs[i].dirty = true;
|
||||||
self.command_line
|
self.command_line
|
||||||
.push_output(crate::tf!("LTSCALE set to {v:.4}").as_ref());
|
.push_output(crate::tf!("LTSCALE set to {v:.4}").as_ref());
|
||||||
|
|
|
||||||
|
|
@ -1189,7 +1189,14 @@ pub fn tessellate(
|
||||||
} else {
|
} else {
|
||||||
color
|
color
|
||||||
};
|
};
|
||||||
|
// Circles use the Lines path for large-coordinate precision, but they
|
||||||
|
// must still preserve the entity's resolved linetype pattern.
|
||||||
|
let (edge_pattern_length, edge_pattern) =
|
||||||
|
if matches!(entity, EntityType::Circle(_)) {
|
||||||
|
(pattern_length, pattern)
|
||||||
|
} else {
|
||||||
|
(0.0, [0.0; 8])
|
||||||
|
};
|
||||||
if !local_pts.is_empty() {
|
if !local_pts.is_empty() {
|
||||||
let (snap, keys, tangents) = if is_first {
|
let (snap, keys, tangents) = if is_first {
|
||||||
is_first = false;
|
is_first = false;
|
||||||
|
|
@ -1217,8 +1224,8 @@ pub fn tessellate(
|
||||||
points_low: local_pts_low,
|
points_low: local_pts_low,
|
||||||
color: edge_color,
|
color: edge_color,
|
||||||
selected,
|
selected,
|
||||||
pattern_length: 0.0,
|
pattern_length: edge_pattern_length,
|
||||||
pattern: [0.0; 8],
|
pattern: edge_pattern,
|
||||||
line_weight_px,
|
line_weight_px,
|
||||||
snap_pts: snap,
|
snap_pts: snap,
|
||||||
tangent_geoms: tangents,
|
tangent_geoms: tangents,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue