Button Getting Reset and resetting a number

My draw line button is getting reset, and then the line disappears.

I like the “animation” where they see the line being drawn because it more closely simulates what they would do if this was on paper.

But then, they need to look at the line, and pick out a few combinations. But as soon as they click on the table, the line disappears. Why is that, and what’s the fix?

(FYI - I preset the function and the max/min. they would have to do that, but for debugging, I put them in)

Two things are happening that I am not sure why.

  1. The second button is disappearing when I click on the table.
  2. “I” is getting reset to 0, making the line disappear when I click on the table.

I appreciate the help!

I know the time resets for buttons when tables have focus, but didn’t think the pressCount should reset. You might try using captures, but it’s a little tedious with tables.

I’m not 100% clear on the general expected behaviour of what’s going on here, but the button pressCount is not getting reset.

The button timeSincePress is though, and as Daniel mentions, this wreaks havoc on any number of things you might want to do with tables.

I’d ask that anyone who feels this button resetting on table cell focus should not be the default behaviour email Desmos support to voice your opinion on the matter. I know many others would appreciate a change in how this behaves. Here is their email: support@desmos.com

I actually see what’s going on now. The line disappeared because T got reset to 0.

Solution: I graphed the line twice, the second time only when {K=1}

code on button 2: ##this button only shows up after the points where plotted correctly
K=when this.pressCount>0 and check.timeSincePress()=0 1 otherwise 0

worked as I wanted it to.

1 Like