From 81e7f78e553086b90b0457e01818f698dce57d79 Mon Sep 17 00:00:00 2001
From: tresabhi <43380238+tresabhi@users.noreply.github.com>
Date: Sun, 10 Nov 2024 22:06:22 -0600
Subject: [PATCH] feat: optimize normalization
---
.../Options/components/CustomShellButton.tsx | 16 ++++++++++------
.../HeroSection/components/TankSandbox/index.tsx | 2 +-
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/CustomShellButton.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/CustomShellButton.tsx
index 9721ef0f9..d87108213 100644
--- a/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/CustomShellButton.tsx
+++ b/packages/website/src/components/Tankopedia/HeroSection/components/Options/components/CustomShellButton.tsx
@@ -163,19 +163,20 @@ export function CustomShellButton() {
minWidth="8rem"
>
- {customShell.normalization ?? 0}°
+ {Math.round(customShell.normalization ?? 0)}°
{
+ step={Number.EPSILON}
+ defaultValue={[customShell.normalization ?? 0]}
+ onValueChange={([value]) => {
console.log('asd');
mutateTankopediaEphemeral((draft) => {
draft.customShell!.normalization = value;
});
- }, 1000)}
+ }}
/>
@@ -184,11 +185,14 @@ export function CustomShellButton() {
Ricochet
- {customShell.ricochet ?? 90}°
+
+ {Math.round(customShell.ricochet ?? 90)}°
+
{
mutateTankopediaEphemeral((draft) => {
draft.customShell!.ricochet = value;
diff --git a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx
index 54e3e78a7..8d72c0495 100644
--- a/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx
+++ b/packages/website/src/components/Tankopedia/HeroSection/components/TankSandbox/index.tsx
@@ -161,7 +161,7 @@ export const TankSandbox = forwardRef(
return (