phetsims / masses-and-springs-basics

"Masses and Springs: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 3 forks source link

[Stretch Screen] ruler returns home when window dimensions change #57

Closed arouinfar closed 5 years ago

arouinfar commented 5 years ago

For https://github.com/phetsims/QA/issues/281, and likely related to #43 and/or #47.

When the browser window is resized, the ruler teleports to its home location. This is pretty jarring and unnecessary.

Steps to reproduce:

  1. Open Stretch screen.
  2. Move ruler anywhere in the play area (next to the spring, for example).
  3. Resize browser window, and the ruler instantly jumps back to its "home" position.
Denz1994 commented 5 years ago

From https://github.com/phetsims/masses-and-springs-basics/issues/47#issuecomment-450911119:

The current behavior causes the ruler to snap back to its original position when the screen size changes or the reset all button is pressed. Is this behavior acceptable?

Following response: https://github.com/phetsims/masses-and-springs-basics/issues/47#issuecomment-450948235

@Denz1994 the behavior in dev.16 looks good!

I think I misunderstood whether the ruler should float or not. The changes in #47 only make the ruler initialize at the correct location on start up not during sim use. I'll make a fix to have the ruler float throughout sim use.

arouinfar commented 5 years ago

when the screen size changes

@Denz1994 I don't think I caught this bit when reviewing #47. When reviewing, the test case didn't include the procedure described in https://github.com/phetsims/masses-and-springs-basics/issues/57#issue-409029937.

Desired flow:

resizing_window

Denz1994 commented 5 years ago

A draggedProperty has been added to the DraggableRulerNode. It acts as a flag to determine when the ruler should float or not. This should be verified in the next RC version.

Denz1994 commented 5 years ago

Because MAS is a dependency of MASB, we have to treat it as a "common code" repo when patching according to the "Manual Maintanance Patching" section in https://github.com/phetsims/phet-info/blob/master/deployment-info/chipper-2.0.md .

Consequently, the masses-and-springs-1.0 branch has been created in the MAS repo to manage these changes. Relevent changes from that branch should be cherry-picked into master for next maintanance patch.

I took the long way around didn't cherry pick the above changes into master, but instead commited the changes into master manually and then cherry-picked them into the masses-and-springs-1.0 branch. Backwards, but effectively the same.

KatieWoe commented 5 years ago

This looks good in 1.0.0-rc.3