Kamal123 wrote:
h0bby1 wrote:
For item lists i first compute the total item height and viewport height to get the scroll buttons height, and start drawing the first item based on the scroll button position. So you always have full items displayed and scroll on per item bases.
For more complex content you might want to either draw everything in a back buffer and scroll / clip on the viewport. For static content its ok. For dynamic content it can be more wasteful.
Or determine which item rect intersect with the viewable part and draw only this with a small offset from the top of viewable items to the top of the viewport, for scrolling at pixel granulosity.
Hi, thank you so much for your reply. What do you do for text items like rich text edit or any gui control that contains text ? Do you draw it to back buffer? And what should be the size of back buffer ? I think the size should be equal to screen size! Am I right?
Thanks in advance
For the moment my system is made with containers that are like windows that contain an object graph, application add controls to the object graph, and the rendering thread loops through containers and deal with clipping/ scrolling to know which controls needs to be rendered where.
Its made to be recursive to have child containers or controls that control the clipping and position at each steps.
In theory it can have a container inside of a scrolled view that contain another scroller etc.
But its completely work in progess im not sure its the best model