phetsims / unit-rates

"Unit Rates" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 2 forks source link

"Double Number Line" accordion box is messed up #201

Closed pixelzoom closed 7 years ago

pixelzoom commented 7 years ago

Should look like this, in published version (1.0.3):

screenshot_337

Currently looks like this in master (marker editor and collapse button partially outside box):

screenshot_338

pixelzoom commented 7 years ago

@jonathanolson suspects that this is related to recent changes that he made to AccordionBox for resizing. Assigning to him to investigate.

jbphet commented 7 years ago

Here is the issue that describes the recent changes to AccordionBox: https://github.com/phetsims/sun/issues/304

jonathanolson commented 7 years ago

(looking into it).

jonathanolson commented 7 years ago

AccordionBox has always put the content directly on the expandedBox, and I was incorrectly checking the expandedBox's bounds after modifying its rectWidth/rectHeight. Since the initial content was outside of these bounds, those bounds were incorrect and it cascaded.

Fixed by using the selfBounds of the expandedBox to lay out expanded content.

@pixelzoom can you verify?

pixelzoom commented 7 years ago

Verified, closing, thanks!