mirror of
https://github.com/scratchfoundation/Gestouch.git
synced 2024-11-27 01:35:40 -05:00
Fix central point calculation for more precise transformations
This commit is contained in:
parent
a036db1aef
commit
9d9fcd20ba
1 changed files with 2 additions and 3 deletions
|
@ -393,9 +393,8 @@ package org.gestouch.gestures
|
|||
x += touch.x;
|
||||
y += touch.y;
|
||||
}
|
||||
// faster then Math.round(x / _touchesCount)
|
||||
_centralPoint.x = x > 0 ? (x / _touchesCount + 0.5) >> 0 : (x / _touchesCount - 0.5) >> 0;
|
||||
_centralPoint.y = y > 0 ? (y / _touchesCount + 0.5) >> 0 : (y / _touchesCount - 0.5) >> 0;
|
||||
_centralPoint.x = x / _touchesCount;
|
||||
_centralPoint.y = y / _touchesCount;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue