PopProjection is not reverting properly after Push2dProjection

Happy new year all,

I’m not able to make use of the new Push2dProjection method within a DisplayPipeline.DrawOverlay event. I was expecting to be used like:

      e.Display.Push2dProjection(); 
      // ... drawing in 2d
      e.Display.PopProjection();   

but PopProjection does not recover the drawing as it should. Are we missing a Pop2dProjection method?

I have five classes subscribed to DisplayPipeline.DrawOverlay and one of they is using Push2dProjection. If I comment Push and Pop code lines, the last class is not displayed (as expected, geometry is in viewport coordinates) and what I have is:


but when I execute the code above (Push2dProjection/Draw/PopProjection) I can see the last class (the bottom rectangle) working as expected, but all the curves of the other classes are glitched at the center.

So it looks to me that PopProjection is not reverting properly, I tried calling all pop… methods as well but nothing.

I haven’t tried refactoring my classes to use DisplayConduit instead of subscribing to DisplayPipeline events, because it would require quite a bit of work but if there are enough reasons for it to be convenient I might try it.

Any help?
Thanks.

Try calling e.Display.Flush(); We cache up drawing operations and flush when state changes. We may not be properly doing this in these projection stack functions.

It works calling Flush() before Push2dProjection(), thank you Steve!
It should be registered as a bug, right? or is it ok to clear the cache every time it is drawn?