Skip to content

TreeControl - Nested Nodes Incorrect Positions. #89

@skln131313

Description

@skln131313

When a nested node with children is toggled it does not invalidate the parent node which causes the node to remain the same size. This can be fixed by adding InvalidateParent() into TreeNode::Open/Close.

But this reveals another error in that the parent node's total height is calculated before the children are given a chance to recalculate their layout size. This means the layout will always be behind one step.

Temporary fix would be to remove the if statement in Base::RecursiveLayout():

if ( NeedsLayout() )
{
    m_bNeedsLayout = false;
    Layout( skin );
}

Though this obviously comes with a performance hit, as every layout will be recalculated every render and may cause flicker.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions