Wrong child position in LayoutContainer

Issue #1073 new
Jan Drabner
created an issue

Under some circumstances, the child of a LayoutContainer is not positioned correctly. In my case, when setting a button within a vertical LayoutContainer (which is in a horizontal LayoutContainer) to vertical alignment center, the center of the root window is used instead of the center of the parent vertical LayoutContainer.

The problem (with an example) is described in this forum topic more detailed: http://cegui.org.uk/forum/viewtopic.php?f=10&t=7016

Comments (10)

  1. Martin Preisler

    You are right. This looks like a bug.

    LayoutContainers take the reference size from their parent. If their parent is a layout container they should take the layout containers size though and not bubble up to the parent's parent.

    Thanks for the report!

  2. Jan Drabner reporter

    I noticed another problem: When the LayoutContainer has a position, let's say 0.1/0.1 (relative), then its children ignore that position and are displayed as if the LayoutContainer was at position 0.0/0.0.

    So what is true about size (original bug) seems to be true about position as well.

  3. Manh Nguyen Tien

    I asked this on IRC but so far had no replies so I'm pasting it here.

    <zer0x> Hi, any ideas why GridLayoutContainer renders my items overlapped with addChild()? I did set its dimensions and the auto positioning was left to right.

    <zer0x> setting auto positioning to disabled and use addChildToPosition showed the same overlapped items too

    <zer0x> I only see the last added item

    <zer0x> well, I call layout() then they appears correctly

    <zer0x> cegui 0.8.7

    <zer0x> created the layout in CEED and attempt to add items in C++ code

  4. Lukas Meindl

    @Manh Nguyen Tien I meant to ask what happens if you, instead of loading a layout, do all these things via C++ code. And if this leads to the same result. If it does, then we can 100% be sure that this is a CEGUI bug and not some problem with how the layout is put together by CEED.

  5. Log in to comment