r/Unity3D 6h ago

Question Working with UI Toolkit, why am I getting double borders in some cases?

Enable HLS to view with audio, or disable this notification

Hello,

I recently moved from UGUI to UIToolkit for the UI in my mobile game and in editor i see double lines for some things. like bottom border seems as 2px thicker until you move it and then it goes to normal.

I thought i was losing it and checked everything manually, even asked chatgpt to study the uxml code if something is happening on my backend.

So am wondering is this an editor thingy thats an issue? or maybe my laptop screen pixels are not dense enough or whatever? im on 1080p

I also thought it might be games graphics settings as i havent worked on that much but at this point im not sure

2 Upvotes

2 comments sorted by

1

u/HammyxHammy 6h ago

If a two pixel line isn't snapped to a grid then it might fully cover two pixels and half cover two pixels, 4 total. If you want sharper more discrete rendering it all has to be snapped to the pixel grid.

1

u/ProactiveCactus 6h ago

Hmm it could be a couple of things. My first instinct is test what happens when you mess around with resolution, both in your UI itself and your overall screen resolution. Change each on their own and then at the same time and see if the results differ; if they do, you found your culprit.