[NO GBP] Fix: Evidences twitching on the detective's board (#91899)

## About The Pull Request

After updating the detective's board styles, a bug appeared that caused
the evidences on the board to twitch, especially when there were other
pieces of evidence on the board and they were moving. This bug was
caused by the fact that a random angle rotation was added for the sake
of aesthetics. When the board was updated, this rotation was
recalculated, resulting in a twitching effect. Now, the rotation is
remembered and does not need to be recalculated every time the board is
updated. My fault

## Why It's Good For The Game

This is fix, why it can be bad for the game?

## Changelog

🆑 FeudeyTF
fix: fixed evidences twitching on the detective's board
/🆑
This commit is contained in:
FeudeyTF
2025-07-01 15:45:06 -07:00
committed by GitHub
parent cf031ab89c
commit 75b1d318f4
@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react';
import { useEffect, useMemo, useState } from 'react';
import { Box, Button, Flex, Stack } from 'tgui-core/components';
import { DataEvidence } from './DataTypes';
@@ -38,7 +38,7 @@ export function Evidence(props: EvidenceProps) {
null,
);
const randomRotation = Math.random() * 2 - 1;
const randomRotation = useMemo(() => Math.random() * 2 - 1, []);
function handleMouseDown(args) {
if (canDrag) {