Closed Luisav1 closed 8 months ago
'Tis a fair point - using indexes the way I did here is quite fragile. I've changed the code to use Maps instead. @Luisav1 - please review and close if you're good with it. I don't know if this impacts the work you're doing or is more of an editorial observation, but I thought I'd pass this back to you either way for at least a quick look.
@jbphet Thanks for the update. The transition to using maps looks solid. Although it doesn't directly impact the work I'm doing, it does offer an easier way of aligning the images, I believe. Closing the issue now.
Found while working on https://github.com/phetsims/joist/issues/958. The
imageSelectionFunction
withinElevationSceneView
currently relies on referencing images based on their index number within an array, which appears to be fragile. This dependency on image order existed before the R&C feature, originally committed by @jbphet in https://github.com/phetsims/number-line-integers/commit/d855bd4d66f2bf2a49ecafacbccce0db708c8f61.Is there be an alternative approach that reduces this dependency? Assigning @jbphet as he did the original commit.