Getting console messages for GUI.Line

I have a function adding horizontal lines to a Vertical stack as follows:

private _addLine(lineY : number) : void {
    const line = new BABYLON.GUI.Line(`line @ '${lineY}`);
    line.x1 = 5;
    line.y1 = lineY;
    line.x2 = WIDTH - 5;
    line.y2 = lineY;
    line.lineWidth = 2;
    line.color = HEADING_COLOR;
    this._panel.addControl(line);
}

Every time some activity occurs inside the panel, I get a bank of lines inside console, stating:

BJS - [11:30:20]: Control (Name:line @ '75, UniqueId:44) is using height in percentage mode inside a vertical StackPanel
BJS - [11:30:20]: Control (Name:line @ '240, UniqueId:64) is using height in percentage mode inside a vertical StackPanel
BJS - [11:30:20]: Control (Name:line @ '330, UniqueId:79) is using height in percentage mode inside a vertical StackPanel
BJS - [11:30:20]: Control (Name:line @ '390, UniqueId:88) is using height in percentage mode inside a vertical StackPanel
BJS - [11:30:20]: Control (Name:line @ '465, UniqueId:91) is using height in percentage mode inside a vertical StackPanel
BJS - [11:30:20]: Control (Name:line @ '695, UniqueId:114) is using height in percentage mode inside a vertical StackPanel

If this is not a bug, how do I correct this? I am not even specifying a height.

haha this one is interesting
You are using a vertical stackpanel so all controls must provide a height in pixel
All controls have a height set to 100% by default. So this is why :slight_smile:

I will fix the line control to report a correct height based on y1, y2 :wink:

2 Likes