From 3ba0d8dcede3e1a6a6f0f9d5410ac7e239224c18 Mon Sep 17 00:00:00 2001 From: eshen16 <64906926+eshen16@users.noreply.github.com> Date: Fri, 12 Sep 2025 02:18:12 +0100 Subject: [PATCH] Player names are hidden when zoomed in too much (#2043) ## Description: Player names are hidden, except small sized fonts, when zoomed in too much(near max), improving user experience by allowing users to see structures clearly without the obstruction of text ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file(no need) - [x] I have added relevant tests to the test directory(n/a) - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Video [video](https://streamable.com/e/mlrfqo?) ## Please put your Discord username so you can be contacted if a bug or regression is found: _federalagent --- src/client/graphics/layers/NameLayer.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/graphics/layers/NameLayer.ts b/src/client/graphics/layers/NameLayer.ts index 21334b02c..0548f6fd8 100644 --- a/src/client/graphics/layers/NameLayer.ts +++ b/src/client/graphics/layers/NameLayer.ts @@ -139,8 +139,14 @@ export class NameLayer implements Layer { const isOnScreen = render.location ? this.transformHandler.isOnScreen(render.location) : false; + const maxZoomScale = 17; - if (!this.isVisible || size < 7 || !isOnScreen) { + if ( + !this.isVisible || + size < 7 || + (this.transformHandler.scale > maxZoomScale && size > 100) || + !isOnScreen + ) { render.element.style.display = "none"; } else { render.element.style.display = "flex";