Once the Windows Zoom gestures starts why would the position of the center point change in the same gesture for subsequent GID_ZOOM messages?
I don't have a touch screen so I tried to simulate the zoom gesture. It gives me the same center point whether I obtain the center point in GF_BEGIN
or GF_END
.
However when I looked at windows sample over here Microsoft-classic-samples repository, GestureEngine.cpp. They are re-calculating the center by taking the average of 2 ptsLocation(s),
// We read here the second point of the gesture. This is middle point between
// fingers in this new position.
_ptSecond.x = gi.ptsLocation.x;
_ptSecond.y = gi.ptsLocation.y;
ScreenToClient(hWnd,&_ptSecond);
// We have to calculate zoom center point
ptZoomCenter.x = (_ptFirst.x + _ptSecond.x)/2;
ptZoomCenter.y = (_ptFirst.y + _ptSecond.y)/2;
I am confused why plsLocation would change for the same gesture i.e. before we receive the GF_END
message?
Microsoft-classic-samples forum "Location of the center of the zoom in GID_ZOOM Gesture" is exactly what I was looking for. I am posting the answer if someone doesn't want to go through the link.
Human beings are not very good at moving two fingers at exactly the same rate outwards. There is usually some error, which can cause the center to shift slightly. (For example, when I do a pinch gesture, my index finger moves faster than my thumb.)