Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lid is not resized when sim is paused. #269

Closed
pixelzoom opened this issue Jun 18, 2024 · 3 comments
Closed

Lid is not resized when sim is paused. #269

pixelzoom opened this issue Jun 18, 2024 · 3 comments

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Jun 18, 2024

Reported by @Nancy-Salpepi. This is not a new problem, and occurs in the 1.0 production version, as well as in main.

Steps to reproduce:

  1. Start the sim.
  2. Go to Ideal screen.
  3. Fill the container with particles until the lid blows.
  4. Pause the sim.
  5. Press the "Return Lid" button.
  6. Make the container smaller until the "Return Lid" button reappears. Note that the lid is not resized or repositioned, as shown in the 1st screenshot below.
  7. Make the container larger. Note that the lid is not resized or repositioned, as shown in the 2nd screenshot below.
screenshot_3374 screenshot_3375
@pixelzoom pixelzoom self-assigned this Jun 18, 2024
@pixelzoom
Copy link
Contributor Author

pixelzoom commented Jun 18, 2024

Relevant bits of code are in IdealGasLawContainer.ts:
public lidWidthProperty, private setWidth, public setDesiredWidth, public resizeImmediately

@pixelzoom
Copy link
Contributor Author

@Nancy-Salpepi please review, close if OK. @arouinfar feel free to have a look too.

Details:

The problem here is that while the lid looks like it is still on the container, it is actually off of the container, but has not yet begun its "spinning" animation. And when the lid is off of the container, resizing the container does not resize the lid. So the sim is actually behaving correctly, but what we're showing is confusing.

I discussed this with @arouinfar, and a reasonable change is to immediately move the lid up a bit (10 pixels seems sufficient) when the "Return Lid" button is made visible. The lid animation will then start from this position. That has been implemented in 8be84b9.

So following the steps in #269 (comment) will now look like the screenshots below. This (hopefully) makes it clear that the lid is not on the container, and eliminates the expectation that the lid should resize when the container is resized.

screenshot_3404 screenshot_3405

@Nancy-Salpepi
Copy link

Working as you described.
Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants