Custom render control leaves "spots" in background
See original GitHub issueDescribe the bug
I created a custom render templated control which represents the Windows 10 busy indicator with circulating dots. This uses context.DrawEllipse
. After each circle of the dots a spot in the color of the dots is left in the background. This spot becomes more and more visible after each circle iteration. Hence, it seems that the background is not correctly cleared. This is visible differently on different machines. Sometimes its in the top row, sometimes its left, sometimes it is both. NOTE: the problem does not appear in the designer view within Visual Studio
To Reproduce Use the busy indicator and set to active.
Expected behavior The “spots” should not appear.
Screenshots I have created screenshots during active animation. I have set the background to darg gray to visualize that the spot happens within the controls view port.
Note: the spots appear outside the dot drawing area which is set to view port - 1.
Desktop (please complete the following information):
- OS: Windows 10
- Version: 11.0.0-preview4
Additional context This is the custom render method:
public override void Render(DrawingContext context)
{
if (!IsActive || DotCount == 0) { return; }
double size = Math.Min(Bounds.Width, Bounds.Height);
double dotRadius = 0.05 * size;
Circle2D circle = new Circle2D(0.5 * Bounds.Width, 0.5 * Bounds.Height, 0.5 * size - dotRadius - 1);
Interval range = new Interval(Phase, Phase + 0.06 * (DotCount - 1));
foreach (double t in range.Discretize(DotCount))
{
Point2D p = circle.GetPointForAngle(GetAngleAt(t));
context.DrawEllipse(Brush, null, new Point(p.X, p.Y), dotRadius, dotRadius);
}
}
You can find the full code of the busy indicator here: https://github.com/llfab/Samples/tree/main/BusyIndicator
Issue Analytics
- State:
- Created 9 months ago
- Comments:17 (6 by maintainers)
Top GitHub Comments
Thanks for taking this on anyways!
I tested it on my machine where it always happens. It seems the PR does not change anything. See images:
Preview4:
PR (11.0.999-cibuild0027551-beta):