uxebu / bonsai

BonsaiJS is a graphics library and renderer
http://bonsaijs.org
Other
1.96k stars 188 forks source link

Layering Tests No. 2 and 3 fail #232

Open SuzanaK opened 8 years ago

SuzanaK commented 8 years ago

The layering test on orbit.bonsaijs.org contains three tests, of which the last two fail:

Test no. 2 expects that the orange box should appear below the red and blue box but the orange box appears on top of the blue and the red box.

Test no. 3 expects that the blue square appears below the red one after one second but the blue square appears immediately on top of the red square.

Tested in Chrome (48.0) and Firefox (44.0).

esoterra commented 8 years ago

I created a modified test that changes the layout of the squares to make the layering more apparent and fixed the layering behavior to match the spec.

Changes:

  1. Removed unecessary numbers in addChild() calls
  2. Changed calls intended to set an item to the bottom of layer from addChild(item,1) to addChild(item,0), which appears to be the primary issue with this test
  3. Shifted the third square in Test no. 1 and Test no. 2 upward to make it overlap with square 1 in order to better demonstrate layer order

Tested in Chrome (49.0)