Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 29, 2025

The documentation incorrectly stated that x, y values in LayoutBounds specify the "upper-left corner" position regardless of positioning mode. For proportional positioning, the actual calculation is (parentDimension - childDimension) * proportionalValue, which centers a child at (0.5, 0.5) rather than placing its corner at the center.

Verified against AbsoluteLayoutManager.cs:

if (HasFlag(flags, AbsoluteLayoutFlags.XProportional))
{
    destination.X = (availableWidth - destination.Width) * destination.X;
}

Changes

  • Removed misleading "regardless of whether absolute or proportional values are used" phrasing
  • Added explicit explanation of how proportional vs absolute positioning differs
  • Clarified that top-left corner positioning applies only to absolute mode
  • Standardized terminology from "upper-left" to "top-left"
Original prompt

This section details on the original issue you should resolve

<issue_title>The documentation for AbsoluteLayout seems to have incorrect information</issue_title>
<issue_description>## Issue description

Unless I am misunderstanding something, the documentation for in the Position and Size children
section (and maybe other places) for AbsoluteLayout seems to give incorrect information.

It says:

The AbsoluteLayout.LayoutBounds attached property can be set using two formats, regardless of whether absolute or proportional values are used:

  • x, y. With this format, the x and y values indicate the position of the upper-left corner of the child relative to its parent. The child is unconstrained and sizes itself.
  • x, y, width, height. With this format, the x and y values indicate the position of the upper-left corner of the child relative to its parent, while the width and height values indicate the child's size.

To my understanding, the parts in bold are incorrect, at least in the case of proportional positioning. It doesn't specify the position of the top left (at the very least it should probably say "top" instead of "upper" anyway...) corner of the child. A non-trivial calculation is being done based on the dimensions of the child and the parent.

If something like ".5, .5" is specified then the top left corner of the child is not placed at the center of the parent (fortunately). For the somewhat trivial case of ".5, .5", the result is that child's center is placed at the center of the parent. More generally, the positioning is proportional to the available space the child has. So, it is proportional to the difference between the parent's dimension and its dimension, i.e. (parentDimension - childDimension) * proportionalValue.

So in terms of the top left corner (which I think is confusing no matter what in the proportional case), it is relative to the parent and the child.

I think the bullet points are correct for absolute positioning, but the first sentence in the section gives them as being valid regardless of whether absolute or proportional values are used, but I think that creates some confusion. What does that even mean? Is it talking about when any of the AbsoluteLayoutFlags.*Proportional values are specified? Or something else? If it is the former, then it is simply incorrect.

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@learn-build-service-prod
Copy link

Learn Build status updates of commit 107dc8f:

✅ Validation status: passed

For more details, please refer to the build report.

@learn-build-service-prod
Copy link

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod
Copy link

Learn Build status updates of commit 28c501c:

✅ Validation status: passed

File Status Preview URL Details
docs/user-interface/layouts/absolutelayout.md ✅Succeeded View (>=net-maui-8.0)

For more details, please refer to the build report.

Copilot AI changed the title [WIP] Fix incorrect information in AbsoluteLayout documentation Fix incorrect AbsoluteLayout documentation for proportional positioning Nov 29, 2025
Copilot AI requested a review from PureWeen November 29, 2025 06:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The documentation for AbsoluteLayout seems to have incorrect information

2 participants