https://kotlinlang.org logo
#compose
Title
# compose
n

nilTheDev

12/15/2021, 6:43 AM
I am trying to create a sudoku game. All the cells of the sudoku board are
boxes
- nested in
rows
and
columns
- with some border around them. However, in some of the
boxes
the border appears to be thicker than others. Anybody knows why this is happening? In the code, the thickness of the border of all the
boxes
are same.
t

tad

12/15/2021, 6:45 AM
Is this a preview, an emulator, or a real device?
n

nilTheDev

12/15/2021, 6:46 AM
@tad It's an emulator.
t

tad

12/15/2021, 6:47 AM
Okay. Did you try zooming to 1:1?
n

nilTheDev

12/15/2021, 6:48 AM
I don't know how to do that. Is it something to be done in the emulator?
t

tad

12/15/2021, 6:49 AM
Nevermind. Just press the screenshot button in the emulator window and zoom in on the screenshot. I have a feeling this is just a result of scaling the emulator display.
If not, and if you require pixel-perfect accuracy with no aliasing, you'll have to do some Canvas work.
This is because a 1.dp line will not always align to the display's pixel grid. You can use Dp.Hairline to get a true single-pixel line, but that can be almost invisible on a high-density display. But in most real-world scenarios, including 1080p phone displays, you'll be hard-pressed to notice aliasing artifacts.
n

nilTheDev

12/15/2021, 6:55 AM
Yep. You were right. I couldn't find where the screenshot was being stored in the emulator. So, I tried it in a real device and there is no issue. All the borders appears to be perfect.
t

tad

12/15/2021, 6:55 AM
Okay, excellent. Carry on!
😃 2
n

nilTheDev

12/15/2021, 6:56 AM
Thank you so much 🙃
a

andylamax

12/15/2021, 9:02 AM
Just here to say big up @tad for helping out the way you did. The way you helped in this scenario should be an example to many
💯 2
❤️ 5
4 Views