Strange artifacts when drawing shapes

When drawing filled shapes such as rectangles and elipses, I noticed there are always 2 strange artifacts of a slightly different colour to the background. I have found this to be the case in both C and MicroPython (using the online simulator).

I’m hoping this is an easy one to fix, but I can’t see what I could be doing wrong. Please try the code snipet below in the online simulator, and look at the resulting rectangle in paint, when you zoom in you will see 2 marks.

Strangely it doesn’t happen if you increase the size of the rectangle to e.g. 60x60.

import lvgl as lv
import display_driver

style = lv.style_t()
style.init()
style.set_bg_opa(lv.OPA.COVER)
style.set_bg_color(lv.palette_lighten(lv.PALETTE.BLUE, 1))
style.set_bg_grad_color(lv.palette_main(lv.PALETTE.BLUE))
style.set_radius(0)

obj = lv.obj(lv.scr_act())
obj.add_style(style, 0)
obj.set_size(30,30)
obj.set_pos(0,0)

image

Has anyone tried this code in the simulator? The glitches disappear if the rectangle size exceeds 35, is this number significant?

I think this is caused by every object being a page in v8, and thus having scrollbars when it gets very small. Adding obj.set_scrollbar_mode(lv.SCROLLBAR_MODE.OFF) should remove them.

Wonderful, thankyou for that!