Search Issue Tracker

Fixed

Fixed in 2021.3.22f1, 2022.2.12f1, 2023.1.0b9, 2023.2.0a4

Votes

2

Found in

2020.3.40f1

2021.3.10f1

2022.1.17f1

2022.2.0b8

2023.1.0a11

2023.2.0a1

Issue ID

UUM-15680

Regression

Yes

[UI Builder] The border of VisualElement is not created when slicing a pixel art sprite

--

-

Reproduction steps:

# Open the attached project “UI_Toolkit_Slicing.zip“
# In the UI Builder window compare the two UI elements (the Button and the VisualElement)

Expected result: the VisualElement holds a sprite and has a 1px border like the Button element
Actual result: the VisualElement does not have a 1px border

Reproducible with: 2020.3.40f1, 2021.2.18f1, 2021.3.10f1, 2022.1.17f1, 2022.2.0b8, 2023.1.0a11
Not reproducible with: 2021.2.17f1

Reproduced on: Windows 10 Pro

Note: the issue reproduces both in the Player and in the Editor

  1. Resolution Note (fix version 2023.2.0a4):

    UI Elements: Added "-unity-slice-scale" USS property to UI Builder and updated drag step for some style fields
    Also updated dragger manipulators for the following UI Builder property inspectors (default drag step updated from 1.0px (old value) to 0.1px (new value):
    - TextShadow's Blur Radius, Offset X and Y fields
    - Slice Scale field

  2. Resolution Note (fix version 2023.1.0b9):

    Fixed UUM-23969 @sebastiend@unity3d.com:
    UI Elements: Added "-unity-slice-scale" USS property to UI Builder and updated drag step for some style fields
    Also updated dragger manipulators for the following UI Builder property inspectors (default drag step updated from 1.0px (old value) to 0.1px (new value):
    - TextShadow's Blur Radius, Offset X and Y fields
    - Slice Scale field

  3. Resolution Note (fix version 2022.2.12f1):

    Fixed UUM-16141 @sebastiend@unity3d.com:
    - UI Elements: Added "-unity-slice-scale" USS property to UI Builder and updated drag step for some style fields
    - Also updated dragger manipulators for the following UI Builder property inspectors (default drag step updated from 1.0px (old value) to 0.1px (new value):

    TextShadow's Blur Radius, Offset X and Y fields
    Slice Scale field

  4. Resolution Note (fix version 2021.3.22f1):

    Fixed UUM-16142 @sebastiend@unity3d.com:
    UI Elements: Added "-unity-slice-scale" USS property to UI Builder and updated drag step for some style fields
    Also updated dragger manipulators for the following UI Builder property inspectors (default drag step updated from 1.0px (old value) to 0.1px (new value):
    TextShadow's Blur Radius, Offset X and Y fields
    Slice Scale field

Comments (1)

  1. BusyRoots

    Oct 16, 2022 13:33

    Since the Unity beta version 2022.2.0b10 one can use the uss style property:
    -unity-sclice-scale: [value]px

    You can calculate the value as follows:
    unity-slice-scale = [your sprite pixels per unit value] / 100

    For example for a sprite with a pixels per unit value of "16" you set -unity-slice-scale: 0.16px
    in the uss style sheet that is attached to the UI element, which uses this sprite (and was sliced with the sprite editor).

    For more details see: https://forum.unity.com/threads/how-does-slicing-in-ui-tookkit-works.1235863/#post-8517644

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.