aboutsummaryrefslogtreecommitdiff
path: root/src/client/util/InteractionUtils.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2022-10-20 11:07:04 -0400
committerbobzel <zzzman@gmail.com>2022-10-20 11:07:04 -0400
commit5df8e9041e7a0e8ac98f0c911a2b603c0d8e89d3 (patch)
treefe7b838877e73bdd06e39f5ea9b43369263be41f /src/client/util/InteractionUtils.tsx
parenta81ab2e6f75681bc4fb3a7b49d2056144e396b94 (diff)
added double-tap to keep ink primitive mode. cleaned up circle drawing and some other gesture code.
Diffstat (limited to 'src/client/util/InteractionUtils.tsx')
-rw-r--r--src/client/util/InteractionUtils.tsx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/util/InteractionUtils.tsx b/src/client/util/InteractionUtils.tsx
index 6622b498d..3cdf4dbd2 100644
--- a/src/client/util/InteractionUtils.tsx
+++ b/src/client/util/InteractionUtils.tsx
@@ -242,16 +242,16 @@ export namespace InteractionUtils {
const centerX = (Math.max(left, right) + Math.min(left, right)) / 2;
const centerY = (Math.max(top, bottom) + Math.min(top, bottom)) / 2;
const radius = Math.max(centerX - Math.min(left, right), centerY - Math.min(top, bottom));
- for (var x = Math.min(left, right); x < Math.max(left, right); x++) {
+ for (var x = centerX - radius; x < centerX + radius; x++) {
const y = Math.sqrt(Math.pow(radius, 2) - Math.pow(x - centerX, 2)) + centerY;
points.push({ X: x, Y: y });
}
- for (var x = Math.max(left, right); x > Math.min(left, right); x--) {
+ for (var x = centerX + radius; x > centerX - radius; x--) {
const y = Math.sqrt(Math.pow(radius, 2) - Math.pow(x - centerX, 2)) + centerY;
const newY = centerY - (y - centerY);
points.push({ X: x, Y: newY });
}
- points.push({ X: Math.min(left, right), Y: Math.sqrt(Math.pow(radius, 2) - Math.pow(Math.min(left, right) - centerX, 2)) + centerY });
+ points.push({ X: centerX - radius, Y: Math.sqrt(Math.pow(radius, 2) - Math.pow(-radius, 2)) + centerY });
break;
case GestureUtils.Gestures.Line: