sharpie7 / circuitjs1

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

SVG & PNG export incorrectly shifts position of undocked scopes, and also fails to export docked scope #874

Open ericfont opened 1 year ago

ericfont commented 1 year ago

Here is a circuit with a docked scope at the bottom and with two undocked scopes I've deliberately nicely placed above their respective input source. Here is a screenshot from my browser:

image

However, when I "export as image" (which is PNG), I get:

circuit-20230609-2240

and when I "export as SVG", I get:

circuit-20230609-2240

There are two bugs:

(1) Both the PNG and SVG export failed to position the undocked scopes in the same position as they were laid out in my browser. (The PNG's scope gets shifted vertically up, and the SVG's scope instead gets shifted a little down and left...I haven't investigated further what conditions cause it to shift in a particular manner.)

(2) Also both the PNG and SVG export don't include the docked scope. (While it could be said that's a feature not a bug, I consider the more correct behavior would be to include the docked scope...presumably the user setup the scope because they consider it important and so they probably would want the scope included in the export, and if they didn't want the scope in the export then they could simply delete the scope before they press export).

Thank you of course for maintaining such a great tool.

ericfont commented 1 year ago

For the record I am using version 2.8.0js and am on Chrome Version 114.0.5735.110 (Official Build) (64-bit).