christolliday / limn

Experimental cross platform GUI library
Other
404 stars 19 forks source link

Rendering error on X11 - webrender doesn't render bottom of rectangle correctly if window is maximized #40

Open fschutt opened 6 years ago

fschutt commented 6 years ago

I don't have time to investigate this currently, but here:

error

... the bottom of the rectangle doesn't get rendered for whatever reason. Probably a webrender mistake.

The layout is correct, as far as I can see:

error_with_borders

Only occurs when the window is maximized! This doesn't happen in a regular 800x600 window. It's only a minor annoyance, though.

fschutt commented 6 years ago

This issue seems to appear when the height of the window (in pixel) is odd. Probably a rounding error.

tones111 commented 6 years ago

I see this with the button example on the bottom and/or right edge when resizing the window.

tones111 commented 6 years ago

This appears to be a symptom of rounding the bounds in rect.rs draw. The border draws properly with the rounding removed. Borders are expanded to a minimum of 2 to prevent the entire side of the rectangle from dropping, but it's not enough to overcome the rounding. The same type of dropped line due to rounding can occur with an odd border width and certain window dimensions but in that case there is at least some potion of the side drawn.

@christolliday can you elaborate on the "bug in webrender that produces artifacts around the corners" that motivated the rounding hack?

christolliday commented 6 years ago

Yeah there were big black artifacts inside the corner radius of rects on older versions of webrender, you'd see it the most clearly in the circles in the circle example, I just tested it and it looks to be resolved now on my machine at least, and it fixes the issue of the missing rect bottom as well. I still see an issue of rect borders at some sizes being thicker by a pixel on the top and left than on the bottom and right at the moment (esp. evident with 2px borders), don't have time to look closer at it at the moment but I'll remove the rounding code.

christolliday commented 6 years ago

Actually scratch that, there are still some artifacts when the rounding is removed, they are less noticeable than before though. You should be able see them if you comment out the rounding code, run the button example and resize the window.