Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wpf-graphics-rendering-overview.md] clarifying VisualTree traversal order #1943

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Order of DrawingGroup operations

### Rendering Order

The visual tree determines the rendering order of WPF visual and drawing objects. The order of traversal starts with the root visual, which is the top-most node in the visual tree. The root visual’s children are then traversed, left to right. If a visual has children, its children are traversed before the visual’s siblings. This means that the content of a child visual is rendered in front of the visual's own content.
The visual tree determines the rendering order of WPF visual and drawing objects. The order of traversal starts with the root visual, which is the topmost node in the visual tree. When visiting any node that has children, the child nodes are always rendered first—according to sibling order listed in the parent—before the parent renders any content of its own. Since display areas that are rendered earlier during a rendering operation can be overwritten by instructions given later on, the content of any parent visual always appears “in front of the content of its children, meaning it can partially or completely obscure them if desired. In computer graphics, this is called the _Painter's algorithm_.

![Diagram of the visual tree rendering order](./media/wpf-graphics-rendering-overview/visual-tree-rendering-order.gif)

Expand Down
Loading