betrusted-io / xous-core

The Xous microkernel
Apache License 2.0
529 stars 85 forks source link

Extra pixel on rounded rectangle #41

Closed bunnie closed 3 years ago

bunnie commented 3 years ago

Ran out of patience tracking this one down, but noting it as something to clean up later on.

This test case: https://github.com/betrusted-io/xous-core/blob/bee1f796ee3a64dc41c6af213bb45858f5f8a64c/services/graphics-server/src/main.rs#L80-L93

Shows an extra pixel in the top right rounded corner. It shows up only when the background color is specified as PixelColor::Light; specifying it as None, it works just fine.

I thought the problem would be a numerical rounding error in computing the border, but with a fill of None the only pixels drawn belong to the border algorithm. However, when a fill of PixelColor::Light is specified, you get the extra pixel on the inside...which make you think the problem is with the fill algorithm. But, there is nothing that would change a fill color from Light to Dark for the fill. In other words, the fill can only draw Light pixels. So how is it side-effecting and causing a stay Dark pixel?

Strange. Something to be pondered on another day.

bunnie commented 3 years ago

Fixed by pull request #67 by @andrewtron3000 , thank you!