Skip to content

GetContentSize() does not behave according to documentation #4070

Closed
@Error-String-Expected-Got-Nil

Description

Per View.GetContentSize() remarks documentation:

/// <para>
/// If the content size was not explicitly set by <see cref="SetContentSize"/>, and the View has visible subviews, <see cref="GetContentSize ()"/> will return the
/// maximum
/// position + dimension of the SubViews, supporting <see cref="Dim.Auto"/> with the
/// <see cref="DimAutoStyle.Content"/> flag set.
/// </para>

However, if we scroll down a bit to the function itself:

public Size GetContentSize () { return _contentSize ?? Viewport.Size; }

_contentSize is only ever set in View.SetContentSize() and View.ContentSizeTracksViewport. The latter only nullifies _contentSize when set to true, and the former just sets it directly after doing some error checking.

I'm unsure if this is simply a feature that was never implemented (but should be), or if the documentation is just outdated/wrong.

If there is a function that does what the remark describes, it should probably be mentioned there instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions