Skip to content

Commit

Permalink
potentiometer keeps changing position when you save/load it (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfalstad committed Nov 11, 2024
1 parent c724338 commit 1e716d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/com/lushprojects/circuitjs1/client/PotElm.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ String dump() { return super.dump() + " " + maxResistance + " " +
void createSlider() {
sim.addWidgetToVerticalPanel(label = new Label(sliderText));
label.addStyleName("topSpace");
int value = (int) (position*100);
int value = (int) Math.round((position-.005)/.0099);
sim.addWidgetToVerticalPanel(slider = new Scrollbar(Scrollbar.HORIZONTAL, value, 1, 0, 101, this, this));
// sim.verticalPanel.validate();
// slider.addAdjustmentListener(this);
Expand Down

0 comments on commit 1e716d2

Please sign in to comment.