mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-05 17:15:19 +00:00
Restore world-stable name scaling
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
} from "../src/client/graphics/PlayerIcons";
|
||||
import {
|
||||
computeNameLayerLayout,
|
||||
computeNameLayerWorldScale,
|
||||
computeTraitorFlashAlpha,
|
||||
computeTraitorFlashDurationSeconds,
|
||||
replaceUnsupportedNameGlyphs,
|
||||
@@ -96,6 +97,11 @@ describe("NameLayerLayout", () => {
|
||||
expect(layout.width).toBe(60);
|
||||
});
|
||||
|
||||
test("combines local label scale with camera scale for world-stable labels", () => {
|
||||
expect(computeNameLayerWorldScale(8, 2)).toBeCloseTo(4);
|
||||
expect(computeNameLayerWorldScale(20, 2)).toBeCloseTo(6);
|
||||
});
|
||||
|
||||
test("matches traitor flash duration thresholds and alpha extrema", () => {
|
||||
expect(computeTraitorFlashDurationSeconds(156)).toBeNull();
|
||||
expect(computeTraitorFlashDurationSeconds(150)).toBeCloseTo(1);
|
||||
|
||||
Reference in New Issue
Block a user