Closed pixelzoom closed 1 year ago
I tried to make selectedZoomProperty
derived from zoomProperty
but received this error from ZoomButtonGroup: Assertion failed: invalid zoomLevelProperty
.
@arouinfar what is the desired PhET-iO API for this? It was designed so that the PhET-iO API is "NORMAL" vs "ZOOMED_OUT". Do you want something more like https://github.com/phetsims/geometric-optics/issues/337 ?
@matthew-blackman let's review this in #917
@arouinfar and I spoke and agreed that the PhET-iO instrumentation should match that of Geometric Optics which is as follows:
zoomScaleProperty is a readonly array of scaling factors that are cycled between by clicking the zoom buttons. The default value is 1, and the possible values should not be restricted to any set mathematical pattern.
zoomLevelProperty is an integer that can be set via PhET-iO, corresponding to the index being using in the array of zoomScaleProperty's possible values. The default value will be the indexOf 1 in the zoomScaleProperty array.
I'll add some // REVIEW comments at points in the code
, and I'll correct small wording or typos. I'll write other notes and observations here.
currentZoomScaleProperty
as the animated zoom level. Should we just rename it to animatedZoomScaleProperty
?Updated available zoom scales to 0.5, 1, and 1.8. This removes the "Large things are so large they cannot be dropped in the toolbox." issue when zoomed in.
@arouinfar ready for review - let me know how you like the three zoom options as they can be easily changed.
Thanks @matthew-blackman. The tree looks good and behaves well.
Updated available zoom scales to 0.5, 1, and 1.8. This removes the "Large things are so large they cannot be dropped in the toolbox." issue when zoomed in.
Not quite. I can't put the dollar bill away at this zoom level, so we need to take it down further. Maybe try 1.6?
Closing this issue and continuing circuit dropping behavior in #938
In https://github.com/phetsims/geometric-optics/issues/337, @arouinfar requested that I look at CCK for how
zoomLevelProperty
was instrumented. Specifically, she referred me tocircuitConstructionKitDc.introScreen.model.zoomProperty
:We ultimately decided not to make geometric-optics look like CCK. But in the process, I noticed a couple of things that I think are worth pointing out.
Looking at the implementation in CircuitConstructionKitModel.ts, I see:
This looks very odd to me, for a number of reasons:
(1)
selectedZoomProperty
is a number, as required by common-code zoom control. It's not derived, and not iO instrumented, which seems questionable.(2)
zoomProperty
is an enumeration, yet has a name similar toselectedZoomProperty
-- which is confusing. Based on its named, I'd expect it to have the same value type asselectedZoomProperty
.(3) It seems like
zoomProperty
should be derived fromselectedZoomProperty
, but it isn't. Instead, there's an odd relationship where they keep each other in-sync by linking to each other. Imo, it's questionable whether this relationship is really needed or a good idea. AndDynamicProperty
is typically used when there's this kind of relationship.