As in subject, I have components that triggers repaint on mouse move, but they are complex and slow to repaint.
I’m getting a lot of mouse move which lead to no change in repaint, as the mouse hasn’t moved enough.
This is a 2 liner (in Component::handleMouseMove)
if (e.getPosition().getDistanceFrom(lastPos) > moveTriggerThreshold) { mouseMove(e); lastPos = e.getPosition(); }
And the method:
void setMouseMoveDistanceTrigger(const int thresholdInPixels) { moveTriggerThreshold = thresholdInPixels; }
Currently, I’m doing this in my components, but it’s a lot of repeated code, and I think it might be better if centralized.
