jdolan / ObjectivelyMVC

Object oriented MVC framework for OpenGL, SDL2 and GNU C. Inspired by Apple's AppKit. Zlib license.
Other
29 stars 7 forks source link

Subview order is not preserved in render sort #20

Closed jdolan closed 7 years ago

jdolan commented 7 years ago

It's expected that siblings sharing the same zIndex will be drawn in their "natural order" so that subviews added later are drawn after (on top of) siblings that were added first. This is currently not the case, and the result is inconsistent zIndex fighting amongst siblings. From system to system, from View to View, the draw order of a given layout is not guaranteed.

The solution would be to check if two Views share the same superview when comparing them. If they share the same zIndex and superview, then use their natural ordering for the comparison.