From 5584dd85022ff6271942971600d9d582bc047cb5 Mon Sep 17 00:00:00 2001 From: FragginWagon Date: Wed, 28 Jan 2026 21:13:26 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Improve=20readability=20of=20scroll?= =?UTF-8?q?=20position=20calculation=20logic=20in=20GamemasterExplorer=20c?= =?UTF-8?q?omponent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pokedex.online/src/views/GamemasterExplorer.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/websites/pokedex.online/src/views/GamemasterExplorer.vue b/code/websites/pokedex.online/src/views/GamemasterExplorer.vue index 59bce73..8f2ee13 100644 --- a/code/websites/pokedex.online/src/views/GamemasterExplorer.vue +++ b/code/websites/pokedex.online/src/views/GamemasterExplorer.vue @@ -766,9 +766,13 @@ function scrollToResult() { if (container) { const containerRect = container.getBoundingClientRect(); const elementRect = lineElement.getBoundingClientRect(); - + // Calculate scroll position to center element in container - const scrollOffset = elementRect.top - containerRect.top - (containerRect.height / 2) + (elementRect.height / 2); + const scrollOffset = + elementRect.top - + containerRect.top - + containerRect.height / 2 + + elementRect.height / 2; container.scrollBy({ top: scrollOffset, behavior: 'smooth' }); } return true;