fix(render): repaint on layer/property edits (#231)
Layer color/linetype/lineweight and MATCHPROP edits set the document dirty flag but never bumped geometry_epoch. The wire caches key on that epoch and bake a ByLayer entity's resolved color at tessellation time, so they returned stale wires until a new entity forced a rebuild. Bump geometry on those four handlers so the edit repaints immediately. Also remove REGEN/REGENALL/REDRAW/REDRWALL: the GPU raster pipeline keeps the display continuously in sync, so on-demand regen/redraw is a no-op concept in OCS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
a994a148fe
commit
f6a7b0885f
6 changed files with 29 additions and 12 deletions
|
|
@ -1148,6 +1148,23 @@ mod layer0_inherit_tests {
|
|||
assert_eq!(&c[..3], &ins[..3], "ByBlock child uses the insert's color");
|
||||
}
|
||||
|
||||
// A *top-level* (non-block-child) entity on layer 0 with ByLayer colour
|
||||
// resolves layer 0's own colour and follows it when the layer is recoloured.
|
||||
// Regression guard for the issue 231 layer-0 repaint path.
|
||||
#[test]
|
||||
fn toplevel_layer0_bylayer_follows_layer_color() {
|
||||
let mut d = doc();
|
||||
let e = child("0", Color::ByLayer);
|
||||
let before = render_style_for(&d, &e).0;
|
||||
if let Some(l) = d.layers.get_mut("0") {
|
||||
l.color = Color::Index(3); // recolour layer 0 -> green
|
||||
}
|
||||
let after = render_style_for(&d, &e).0;
|
||||
let green = tess_util::aci_to_rgba(&Color::Index(3));
|
||||
assert_eq!(&after[..3], &green[..3], "top-level layer-0 ByLayer must follow layer 0's colour");
|
||||
assert_ne!(&before[..3], &after[..3], "colour must change after recolour");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn explicit_color_wins_even_on_layer0() {
|
||||
let d = doc();
|
||||
|
|
|
|||
Loading…
Reference in a new issue