play-co / timestep

GNU General Public License v3.0
16 stars 27 forks source link

LinearLayout zIndex behaviour in browser and native #11

Open roosmaa opened 11 years ago

roosmaa commented 11 years ago

It seems that zIndex ordering of linear layout children is ignored (instead the order of adding the subview is used) when building for native.

For example:

import ui.View;

exports = Class(GC.Application, function () {

    this.initUI = function () {
        var cont = new ui.View({
            superview: this.view,
            layout: "linear",
            direction: "vertical"
        });

        new ui.View({
            superview: cont,
            height: 50,
            width: 50,
            backgroundColor: "green",
            zIndex: 3
        });

        new ui.View({
            superview: cont,
            height: 50,
            width: 50,
            backgroundColor: "yellow",
            zIndex: 2
        });

        new ui.View({
            superview: cont,
            height: 50,
            width: 50,
            backgroundColor: "red",
            zIndex: 1
        });
    };

    this.launchUI = function () {};
});

This code displays traffic lights in browser (red, yellow, green), however, on native it is flipped (green, yellow, red).

bubbleboy14 commented 11 years ago

Hello roosmaa. Thanks for the detailed bug report and test case. Great catch. We'll see what we can do about this. Thanks again for all your hard work. We really appreciate it.