question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom render control leaves "spots" in background

See original GitHub issue

Describe 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. image

Note: the spots appear outside the dot drawing area which is set to view port - 1. image

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:open
  • Created 9 months ago
  • Comments:17 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
llfabcommented, Dec 14, 2022

Thanks for taking this on anyways!

0reactions
llfabcommented, Dec 14, 2022

I tested it on my machine where it always happens. It seems the PR does not change anything. See images:

Preview4: Preview4

PR (11.0.999-cibuild0027551-beta): 11 0 999-cibuild0027551-beta

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create a custom rendering control ? #2176
Into the MainWindow, we have an Image control, which at each render passes of the game background thread, changes its Source property with ......
Read more >
Mesh Renderer component
The Renderer uses a 3D grid of interpolated Light Probes. Custom Provided, The Renderer extracts Light Probe shader uniform values from the ...
Read more >
Choosing and configuring a render pipeline and lighting ...
You can use the following decision chart to quickly find out which render pipeline you should select based on a few critical criteria....
Read more >
Render Studio Examples and Resources
Render Studio Examples and Resources ... This topic includes additional examples and resources to get the most out of the Render Studio application....
Read more >
Shape Splatter | Substance 3D Designer
Automatically adjust the height range relative to background, instead of defining an absolute range. Allows less or more control. Height Offset: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found