kaiakz / walv

[WIP] A LittlevGL-GUI designer on your browser
Apache License 2.0
108 stars 24 forks source link

Highlight Implement #2

Closed kaiakz closed 5 years ago

kaiakz commented 5 years ago

It is great to highlight the selected item. I have finished the swapping data between JS and WASM, JS can get a string(widget attribute) from WASM and parse it into JSON. 截图_2019-08-23_09-10-21 We can get the position and size of the widget now, it's time to achieve the highlight, I think there are some ways:

In Browser, since WASM displays on a Canvas

In WASM:

kisvegabor commented 5 years ago

In my opinion, it's better to use the SDL or JavaScript to display a rectangle because it will give more flexibility later.

The purpose of groups is to enable keyboard/encoder navigation and highlighting is designed to work well with typical selectable objects. Some issues:

So, in summary, I think manually drawing a rectangle will give a more flexible and predictable result.

kaiakz commented 5 years ago

OK, I use JS to the CANVAS. Due to WASM also draw on CANVAS, highlights sometimes can't display normally, I might fix it later.