sharpie7 / circuitjs1

Electronic Circuit Simulator in the Browser
GNU General Public License v2.0
2.35k stars 642 forks source link

Fix clearing on model dialog #607

Closed nulldg closed 3 years ago

nulldg commented 3 years ago

This commit fixes a bug in the composite model (ie subcircuit) editor dialog where the chip display is not cleared properly, resulting in buffer garbage. This bug occurs when the model is large and the camera is automatically zoomed out, and is caused by the rendering context having an undefined transform when clearing the background. Resetting the transform before clearing fixes this bug.

Image of the model displaying garbage; Notice the top-left corner is cleared properly, whereas the rest is not. image