Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z-Index is broken since v0.24.5 #1678

Closed
djcsdy opened this issue Oct 4, 2020 · 1 comment · Fixed by #1679
Closed

Z-Index is broken since v0.24.5 #1678

djcsdy opened this issue Oct 4, 2020 · 1 comment · Fixed by #1679
Assignees
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior priority 1 Excalibur is unusable in most use cases or severely degraded

Comments

@djcsdy
Copy link
Contributor

djcsdy commented Oct 4, 2020

Steps to Reproduce

  1. Create some actors.
  2. Set a different z-index on each actor.
  3. Position the actors to overlap.

Expected Result

Actors with a higher z-index should be displayed in front of actors with a lower z-index.

Actual Result

Actors are displayed in no particular order.

Environment

  • browsers and versions: Firefox 80
  • operating system: Windows 10
  • Excalibur versions: 0.24.5

The problem is commit 855ce51.

In this commit calls to SortedList.getComparable have been changed from getComparable.call(element) to getComparable(element). In other words, element was previously passed as this, but now it is passed as an argument. However the actual implementation passed as getComparable still expects element to be passed as this.

@eonarheim
Copy link
Member

@djcsdy Good find, definitely an issue

@eonarheim eonarheim added bug This issue describes undesirable, incorrect, or unexpected behavior priority 1 Excalibur is unusable in most use cases or severely degraded labels Oct 4, 2020
@eonarheim eonarheim self-assigned this Oct 4, 2020
djcsdy added a commit to dcgw/bunny-patrol that referenced this issue Oct 4, 2020
Z-index sorting is broken in v0.24.5.

See excaliburjs/Excalibur#1678
eonarheim added a commit that referenced this issue Oct 4, 2020
Closes #1678 
Also Closes #888 

## Changes:

- Fix z-index regression in sorted list
- Add safety around z-index setting that fixes #888
- Adds a unit test to ensure this isn't broken in the future
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior priority 1 Excalibur is unusable in most use cases or severely degraded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants