Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Strikethrough disappears at certain screen resolutions

Discussion in 'UGUI & TextMesh Pro' started by RobbyZ, Feb 10, 2020.

  1. RobbyZ

    RobbyZ

    Joined:
    Apr 17, 2015
    Posts:
    38
    At smaller screen resolutions, strikethrough seems to disappear.

    Here is an example:

    UnityStrikethroughMissing.png

    Is there a configuration setting I should play with, or is it a bug?
     
  2. Antistone

    Antistone

    Joined:
    Feb 22, 2014
    Posts:
    2,833
    I haven't counted the individual pixels in your pictures, but I would guess that what's happening is that you've shrunk to a size where the nominal thickness of the strikethrough line is less than 1 pixel, and this is getting "rounded" to either 0 or 1 (probably depending on where within the pixel the line is positioned).

    It would arguably be smarter for the text to do some sort of dithering on the strikethrough line rather than "rounding" the thickness, but I'd say that's more like the absence of an advanced feature than it is like a bug.
     
  3. RobbyZ

    RobbyZ

    Joined:
    Apr 17, 2015
    Posts:
    38
    That definitely seems possible. I'd also be fine with an option to round up the thickness to at least 1 to ensure the strikethrough always is displayed.
     
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    The behavior is most likely (as @Antistone pointed out) related to the height of the Underline / Strikethrough being less than 1 pixel.

    Making sure the Underline or StrikeThrough cannot be less than 1 pixel might do the trick. I'll have to experiment with this.

    P.S. I am not always able to reply to posts but rest assured that I read all the posts related to TMP on the forum.