Spaces:
Running
Running
Commit ·
6ce87f4
1
Parent(s): 3d072d9
updates
Browse files
frontend/src/components/PitchView.jsx
CHANGED
|
@@ -52,10 +52,8 @@ export const PitchView = ({
|
|
| 52 |
const updateScale = useCallback(() => {
|
| 53 |
if (!containerRef.current) return;
|
| 54 |
const w = containerRef.current.offsetWidth;
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
// visually consistent at any viewport.
|
| 58 |
-
setScale(Math.min(MAX_SCALE, w / DESIGN_WIDTH));
|
| 59 |
}, []);
|
| 60 |
|
| 61 |
useEffect(() => {
|
|
@@ -83,6 +81,7 @@ export const PitchView = ({
|
|
| 83 |
left: "50%",
|
| 84 |
marginLeft: -(DESIGN_WIDTH / 2),
|
| 85 |
top: 0,
|
|
|
|
| 86 |
...extraStyle,
|
| 87 |
});
|
| 88 |
|
|
|
|
| 52 |
const updateScale = useCallback(() => {
|
| 53 |
if (!containerRef.current) return;
|
| 54 |
const w = containerRef.current.offsetWidth;
|
| 55 |
+
const next = Math.min(MAX_SCALE, w / DESIGN_WIDTH);
|
| 56 |
+
setScale(prev => Math.abs(prev - next) > 0.005 ? next : prev); // skip tiny changes
|
|
|
|
|
|
|
| 57 |
}, []);
|
| 58 |
|
| 59 |
useEffect(() => {
|
|
|
|
| 81 |
left: "50%",
|
| 82 |
marginLeft: -(DESIGN_WIDTH / 2),
|
| 83 |
top: 0,
|
| 84 |
+
willChange: "transform",
|
| 85 |
...extraStyle,
|
| 86 |
});
|
| 87 |
|