I'm trying to draw a simple "X" in the middle of a button. I've put in the following drawing code:
width, height = self.size
x, y = self.pos
x1, x2 = x + int(width*0.3), x + int(width*0.7)
y1, y2 = y + int(height*0.3), y + int(height*0.7)
with self.canvas:
Line(points=[x1, y1, x2, y2], width=1, cap='none')
Line(points=[x2, y1, x1, y2], width=1, cap='none')
self.canvas.ask_update()
The two diagonal lines, even though they're using the exact same integer coordinates, are not drawn the same. The upper-left to lower-right is drawn aliased, and the other is not. How can I make them consistent?
I should mention that I'm testing with the Windows version of kivy and I haven't tried it on any other platform yet.
Add 0.5 or 0.375 to your x/y coordinates.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With