Search Unity

VisualElements do not repaint on scale

Discussion in 'UIElements' started by Cence99, Sep 13, 2019.

  1. Cence99

    Cence99

    Joined:
    Apr 14, 2013
    Posts:
    39
    Hey there,

    I have an issue that leads to my VisualElements, in particular the text, to become very blurry when their parent is scaled down and up again (zoom functionality in my editor window).

    When translating the VisualElement, it becomes crisp. My guess is that changing a VisualElement's transform forces it to repaint, while changing its parent's transform does not repaint the children.

    I tried calling Repaint() in my EditorWindow class to force a repaint of everything, without success. I also tried calling MarkDirtyRepaint() on the root VisualElement, with no luck either.

    Is there a more efficient way to repaint all VisualElements than calling MarkDirtyRepaint() on every child individually?

    Here is a screen of the blur:



    Thanks in advance!
     
  2. jonathanma_unity

    jonathanma_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    61
    Hi Cence99,

    This looks like an issue with the text system, my guess is that when zooming the glyphs are not regenerated so the text appears blurry.

    Is it possible for you to report this as a bug with that window via the Bug Reporter? (Inside Unity, from the top menu : Help > Report a bug..)

    There's none because repainting all VisualElements is something that needs to be avoided, the renderer will take care of repainting what is needed. MarkDirtyRepaint() is useful when you have custom rendering on a VisualElement.
     
  3. Cence99

    Cence99

    Joined:
    Apr 14, 2013
    Posts:
    39
    Yes, I reported it with an extensive description on how to reproduce it. Thanks!
     
    jonathanma_unity likes this.