pfalstad / circuitjs1

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

Add a rectangle around the Relay element #13

Closed nulldg closed 3 years ago

nulldg commented 3 years ago

These are the changes for https://github.com/sharpie7/circuitjs1/issues/618#issuecomment-859720122.

Feel free to make changes to the branch.

pfalstad commented 3 years ago

The boxes are a good idea. But I think the boxes need to be slightly smaller and/or need to be configurable or only present for newly created relays, because they cause some problems in the example relay circuits (like Other Passive Circuits/Relays/Relay Oscillator) with the boxes overlapping other circuit elements.

nulldg commented 3 years ago

I was going to make another commit to make it smaller, but then decided against it since I have a habit of making too many commits per pull. I'll do that now - thanks for the heads up!

nulldg commented 3 years ago

The boxes are now smaller and there's an option to show/hide it. Old circuits will have it hidden by default, new circuits will show it by default.

pfalstad commented 3 years ago

I might go with 25 for boxWScale , how does that look to you?

nulldg commented 3 years ago

Looks good! The value 40 was calculated based on the other values to make it square like a real relay, but making it more compact is good too.