slate icon indicating copy to clipboard operation
slate copied to clipboard

Custom cursors are not so responsive

Open vakokako opened this issue 2 years ago • 1 comments

When moving crosshair cursor, there is a slight delay compared to standard mouse. I've seen that custom cursor was done with quick items and sending mouse position via signals/slots.

I'm not so familiar with qt quick, but could this be implemented without signal/slots to remove the delay?

vakokako avatar Mar 21 '22 09:03 vakokako

Hi, thank you for the feedback. :)

I am using Qt Quick items for the cursors currently:

https://github.com/mitchcurtis/slate/blob/7fd4bba63eb550a96c7d5b8b1c93e62205529ce2/app/qml/ui/CanvasContainer.qml#L50-L78

The benefit of this approach is that the cursors can be coloured, which means we can also use the inverse of the colour under the pixel to ensure that the cursor has good visibility due to contrast.

Another advantage is that we can have nice, smooth cursors. From memory, a custom QCursor shape will be quite blocky and not smooth, but I'd have to double-check that.

The disadvantage is, as you've seen, it can lag behind the mouse a bit due to it not being a system cursor. That's unrelated to signals and slots though, I think.

mitchcurtis avatar Mar 22 '22 06:03 mitchcurtis