phetsims/vector-addition

Sum vectors visibility bug on Lab screen

Closed this issue · 8 comments

Steps to reproduce:

  1. Lab screen
  2. check both Sum checkboxes.
  3. select one sum on graph
  4. other sum disappears from graph

E.g.:

screenshot_1429

Apparently its just the label that's disappearing when the sum is zero. On the Lab screen, only one sum vector is labeled. It's labeled if it's selected, or if one of its associated vectors is selected.

For example:

  1. Lab screen
  2. drag one blue vector to the graph
  3. drag one red vector to the graph
  4. check both Sum checkboxes.
  5. select one sum on graph, the other sum's label disappears

screenshot_1493

Options:

(1) Always show both sum vectors as s⃗. This is currently the case when following the steps in #160 (comment). It could be confusing to have the same label on 2 vectors.

(2) Always show both sum labels, but use subscripts, i.e. s⃗1 and s⃗2, include those labels in the Sum checkboxes, e.g. "Sum s⃗1". We might want to also change "Sum" checkboxes first 2 screens to "Sum s⃗".

(3) Don't show a label for any zero-magnitude sum vector. This would be inconsistent with other screens, so harder to implement.

(4) Do nothing, live with this weirdness.

My preference is option (3). @arouinfar, your call.

Raising priority, since we're trying to get into dev testing by 10/1.

Addressed in the above commit. The sum vector will only be displayed when the Sum checkbox is checked and the sum is defined.

@arouinfar please review in master.

Rats, this is not totally fixed -- the value is being shown when "Values" is checked.

screenshot_1502

Fixed again :) I had to introduce a new BooleanProperty in SumVector, isDefinedProperty.

@arouinfar please review in master.

Looks like the changes proposed in #187 (comment) plus isDefinedProperty have done the trick. I am unable to reproduce this bug. Closing.