Im trying to develop a canvas (panel/B4Xview) which has a grid
When the pointer is dragged across the grid, each square will change color.. like a bitmap icon editor.
When detecting TOUCH_ACTION_MOVE events, I get a bunch of them, then inexplicable pauses.
This means that I cannot fill a row of squares by dragging the pointer.. some are missed.
I have read in other posts that 'too many events' may be happening, and to try handling 'every 5'
That's not the issue, and it makes things worse if I skip additional messages in this way
Even if I log every received event, there are gaps in the events, and moving the pointer slowly is sometimes not enough.. events just stop happening, leaving gaps of an inch or so on screen.
It may be my low-end Android tablet, but since my potential users may have similar tablets, it has to work for them.
Games work fine , after all
What can be done to improve this?
In the Touch event , I have only this code:
When the pointer is dragged across the grid, each square will change color.. like a bitmap icon editor.
When detecting TOUCH_ACTION_MOVE events, I get a bunch of them, then inexplicable pauses.
This means that I cannot fill a row of squares by dragging the pointer.. some are missed.
I have read in other posts that 'too many events' may be happening, and to try handling 'every 5'
That's not the issue, and it makes things worse if I skip additional messages in this way
Even if I log every received event, there are gaps in the events, and moving the pointer slowly is sometimes not enough.. events just stop happening, leaving gaps of an inch or so on screen.
It may be my low-end Android tablet, but since my potential users may have similar tablets, it has to work for them.
Games work fine , after all
What can be done to improve this?
In the Touch event , I have only this code:
B4X:
Dim thex As Int =Floor(X/ squaresize)
Dim they As Int =Floor(y/ squaresize)
'lastx and lasty are global properties
If ( lastx <> thex Or lasty <> they ) Then 'this is to prevent drawing if we are still 'in' the previous square
'rct is a rect
rct.Initialize (thex*squaresize,they * squaresize, thex*squaresize+ squaresize,they * squaresize+ squaresize)
mycanvas.DrawRect (rct, thecolor,True,1)
end if
lastx = thex
lasty = they
mycanvas.invalidate