From 75b1d318f4c53d458fb2c8b13c97a71a9eeaaf24 Mon Sep 17 00:00:00 2001 From: FeudeyTF <72273449+FeudeyTF@users.noreply.github.com> Date: Wed, 2 Jul 2025 01:45:06 +0300 Subject: [PATCH] [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 :cl: FeudeyTF fix: fixed evidences twitching on the detective's board /:cl: --- tgui/packages/tgui/interfaces/DetectiveBoard/Evidence.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tgui/packages/tgui/interfaces/DetectiveBoard/Evidence.tsx b/tgui/packages/tgui/interfaces/DetectiveBoard/Evidence.tsx index ae7c30652b6..874c7dfddb6 100644 --- a/tgui/packages/tgui/interfaces/DetectiveBoard/Evidence.tsx +++ b/tgui/packages/tgui/interfaces/DetectiveBoard/Evidence.tsx @@ -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) {