Diagram Rendering at small scales


I have a question regarding rendering at different scales in diagrams. (I am using GoWPF

I am designing some sort of class diagram, and here’s a screenshot of my current result:

The container on the left looks “sharp”, while the one on the right looks blurry.

The other behaviours related to this issue are the following: depending on the level of zoom and their position on the screen, sometimes the right one looks sharp and the left one looks blurry, sometimes they both look blurry, and sometimes they both look sharp. At bigger scales they usually look good.

To me, this seemed like some sort of WPF issue, when rendering things at different small scales. The different scales are controlled by the DragZoomingTool.

Also, I thought at first it was simply TextRendering issue, but when I look at the the small cube icon inside class containers, they look blurry as well.

But since I realized that the Entity Relationship diagram, from which I based myself on for making this example, does not suffer from this issue, this problem not stopped intriguing me.
It appears that after adding a few too many features to the original example, this problem started happening.

As an example, I have noticed that when zooming in/out very quickly in the ER diagram example, there is kind of like a small period of time (less than a half a second), where some parts of the class container look blurry (SupplierID below, left image).

After that, the rendering looks always like the image on the right.

It seems to me as if in my case the rendering of my class containers stopped half-way, sometimes resulting in the left image look.


Update. I’ve set the DragZoomingTool SnapsToDevicePixels to True, without the best success.

        <go:Diagram.DragZoomingTool >
            <go:DragZoomingTool SnapsToDevicePixels= "True"></go:DragZoomingTool>

There is no point in trying to set any UIElement or FrameworkElement properties on any DiagramTool (or DiagramLayout or CommandHandler) because they are not visual objects.

We already try to align to whole pixels when we can for scrolling, but with scaling/zooming it is inherently something beyond our control.

Thanks. This is indeed beyond the diagram’s control, I managed to find what the issue was.

It appears that having a DropShadowEffect in a Border causes the elements and all sub-elements of the Border to be rendered into a Bitmap first.

The workaround is to make the Border a sibling of the content instead of a parent.


That’s a great suggestion.