From 0e0ac10b20de7f5a57ccd431cf5e2b2e79f7e762 Mon Sep 17 00:00:00 2001 From: Joan Date: Sat, 7 Feb 2026 22:48:11 +0100 Subject: [PATCH] fix(ui): improve location view styling (centered enemy images, correct dropdown pos) --- pwa/src/components/game/LocationView.css | 11 +++++++++++ pwa/src/components/game/LocationView.tsx | 7 +++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/pwa/src/components/game/LocationView.css b/pwa/src/components/game/LocationView.css index c16274f..2244e09 100644 --- a/pwa/src/components/game/LocationView.css +++ b/pwa/src/components/game/LocationView.css @@ -8,10 +8,21 @@ /* Ensure padding inside container */ } +/* Padded Image for enemies */ /* Padded Image for enemies */ .padded-image { padding: 10px; box-sizing: border-box; + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; +} + +.padded-image img { + object-fit: contain !important; + /* Ensure enemies don't get cropped by cover if padded */ } /* Remove old expanded grid styles */ diff --git a/pwa/src/components/game/LocationView.tsx b/pwa/src/components/game/LocationView.tsx index 90d8538..d1dbd49 100644 --- a/pwa/src/components/game/LocationView.tsx +++ b/pwa/src/components/game/LocationView.tsx @@ -102,11 +102,10 @@ function LocationView({ if (activeDropdown === id) { setActiveDropdown(null) } else { - const rect = e.currentTarget.getBoundingClientRect() - // Fix: GameDropdown uses fixed positioning, so we don't add scroll offsets + // Use mouse position for grid-like dropdown behavior setDropdownPos({ - x: rect.left, - y: rect.bottom + 5 + x: e.clientX, + y: e.clientY }) setActiveDropdown(id) }