From 6d20801efe9eeaf45efe509be3fe2290e40557ae Mon Sep 17 00:00:00 2001 From: Stewart Allen Date: Sun, 9 Oct 2022 18:03:45 -0400 Subject: [PATCH] fixes #197 invalidate tabs on scale and traces on scale or rotate --- src/kiri-mode/cam/client.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/kiri-mode/cam/client.js b/src/kiri-mode/cam/client.js index 35aeaada..9e41dd72 100644 --- a/src/kiri-mode/cam/client.js +++ b/src/kiri-mode/cam/client.js @@ -146,6 +146,25 @@ CAM.init = function(kiri, api) { "selection.rotate" ], updateStock); + // invalidate trace ops on scale or rotate + api.event.on([ + "selection.scale", + "selection.rotate" + ], () => { + for (let op of current.process.ops) { + if (op.type === 'trace') { + op.areas = {}; + } + } + }); + + // invalidate tabs when scaleds + api.event.on([ + "selection.scale", + ], () => { + func.tabClear(); + }); + api.event.on([ // update tab color/opacity on dark/light change "boolean.update"