Closed Nancy-Salpepi closed 1 year ago
I think this is a weird situation because the button isn't always there, and if we change the drag bounds so that the user can't drag this button off-screen, then ten frames would never be able to exist close to the left edge. But if you drag an empty ten frame, you can get closer. This seems strange to me as well, and if we start coming up with logic that involves bouncing something back in the play area or other edge cases, this becomes a huge thing.
Given the nature of this sim's timeline and resources, I would prefer to defer this until we have a client who wants a specific behavior.
@chrisklus will spend 30 minutes investigating the options and report back.
@marlitas @amanda-phet and I worked on this issue. This is tricky because we are constraining the position of the ten frame by its model bounds, which does not include the return button, and there is only return button in the view. We have an idea to use a constant from the size of the return button to change the constraining function in the ten frame's model. BUT now I'm realizing that would be importing a view thing into a model file which isn't great. Patch below to show where this constant would be factored into the model constraint.
@zepumph and I handled this in the above commit. We made space for the return button when dragging whether it is visible or not. We were also able to do this in the view so we didn't need to import any constants to get the width of the return button.
Back over to @Nancy-Salpepi to test on phettest, thanks! Feel free to close if looking good.
This looks good initially, but if I make my window size smaller, it moves out of view again.
My guess is that this is correct, since this is the kind of sim that expands its controls to the edge of the screen instead of keeping to the dev bounds.
This is the same for a sim like projectile-motion:
Over to @chrisklus to close if all is well.
I think @zepumph may have missed what @Nancy-Salpepi was demonstrating in https://github.com/phetsims/number-compare/issues/29#issuecomment-1483338438. That still looks incorrect to me and inconsistent with the drag behavior that was fixed in earlier commits. Leaving self-assigned to fix.
Ahh yes, thanks. Sorry @Nancy-Salpepi, I was not paying close enough attention. So rude. I'll take a look now.
Ok. @chrisklus and I weren't handling the general change when the play area drag bounds changed, and instead only the dragging logic. I set things up so all dragBounds changes go through the Node so that the return button bounds can be offset. @Nancy-Salpepi this should be fixed now. Please review.
OK! Check this one off the list too!
Test device MacBook Air M1 chip
Operating System 13.2.1
Browser Safari
Problem description For https://github.com/phetsims/qa/issues/917, if I set up a ten frame on the left side of the screen and add an object, the return button is mostly offscreen.
Visuals