phetsims / expression-exchange

"Expression Exchange" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 2 forks source link

Term jump is causing symbols to jump in an expression #112

Closed phet-steele closed 7 years ago

phet-steele commented 7 years ago

This issue relies on the "jump" that occurs when you grab a term on a touch screen. Therefore, this issue is not exhibited with a mouse. Additionally, the simplify negatives checkbox MUST be checked

  1. Go to a screen with a "simplify negatives" checkbox and check it
  2. Create an expression. The expression does NOT need to have negatives in it
  3. Start editing the expression
  4. Touch one of the terms and both the term and some symbols will jump

This video demonstrates the above steps. The game screen here has the checkbox enabled and show the problem, where the other screen does not have it checked (or even an option) and does not show the problem:

ee15

Seen on iPad Air 2 iOS 10.3.2. For phetsims/tasks/issues/860.

jbphet commented 7 years ago

Fixed this by making Y position of the operators based only on expression height, not term position, and this seems to work. Will leave open and unassigned, and will have it verified on next release.

phet-steele commented 7 years ago

@jbphet the X position of the operators can still be moved whether I grab towards the left or right of a term. This causes a sort of "jumpiness" that could be distracting. Is this easy to address?

jbphet commented 7 years ago

I looked at it and, unfortunately, it is not easy to address. In general, when an expression layout is updated, the coin term positions are determined and then the operators are positioned evenly between the coin terms. I was able to change the code that positions the operators such that the vertical center of the expression was used for the Y position, which solved the issue with the operators jumping in the vertical direction. However, there isn't a similar constant value that I can use for the X positions. I could probably do something elaborate like track the nominal, non-jumped positions of all coin terms, but it would make the code more complex. The visual effect seems subtle enough to me that I don't think the added complexity is worth it. In other words, my cost-benefit analysis is leading me to recommend leaving it as it.

Back to you @phet-steele. If you feel that it is worth the added complexity, please bring in @amanda-phet and we will make a call.

phet-steele commented 7 years ago

This is fine as-is then, thanks for the input @jbphet. Closing as fixed!