alexrudd2 / saxi

Tools & library for driving the AxiDraw pen plotter
GNU Affero General Public License v3.0
5 stars 1 forks source link

Selecting layer functionality can partially crash #102

Closed alexrudd2 closed 11 months ago

alexrudd2 commented 11 months ago

(1) Run a plot with multiple layers (= svg groups) (2) Click in the layers dropdown. (Perhaps removing the layer it's currently plotting?) (3) Observe the entire webpage goes blank. (4) Refresh, restoring most of the webpage (5) Observe the layers dropdown is totally gone although the plot continues.

I need to reproduce (and grab the console error messages). This was on brushless-v4

alexrudd2 commented 11 months ago

Reproduced on both brushless-v4 and on main (so it's a latent bug)

The key appears to be selecting/deselecting any layer while plotting, not necessarily the current one.

Screenshot 2023-10-09 at 6 24 23 PM
    const pos = motion instanceof XYMotion
      ? motion.instant(Math.min(microprogress / 1000, motion.duration())).p
      : (plan.motion(state.progress - 1) as XYMotion).p2;
    const {stepsPerMm} = Device.Axidraw;
    const posXMm = pos.x / stepsPerMm;
    const posYMm = pos.y / stepsPerMm;
alexrudd2 commented 11 months ago

Does not happen on FX; only Chrome.

I think the best thing to do is disable the layer selector during a plot.