dotnet / dotnet/wpf

RenderData.GetContentBounds should cache bounds when possible

Open
#11,382 1 comment 1 reaction 0 assignees View on GitHub
:mailbox_with_no_mail: waiting-author-feedback Needs minimal repro project needs more information
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

I am drawing many lines into a DrawingVisual and based on profiling it is taking longer to compute the bounds each time Visual.PrecomputeContent is called than it is to render it! The lines are all drawn with a frozen pen so it should be possible to know that the DrawingVisual cannot change and cache the bounding box. I would even be willing to have a OverrideBounds property on DrawingVisual that I can set when I know the bounding box won't change.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.