rayzee 5.9.2 → 5.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -31,9 +31,12 @@ export class TileHelper {
|
|
|
31
31
|
// Whether the user has enabled the tile helper via UI toggle
|
|
32
32
|
this.enabled = true;
|
|
33
33
|
|
|
34
|
-
// Style
|
|
34
|
+
// Style — line width derives from display size each frame so the
|
|
35
|
+
// border looks the same thickness regardless of canvas resolution.
|
|
35
36
|
this._borderColor = 'rgba(255, 0, 0, 0.6)';
|
|
36
|
-
this.
|
|
37
|
+
this._borderWidthRatio = 1 / 540; // ~2px on 1080p, ~4px on 4K
|
|
38
|
+
this._borderWidthMin = 1.5;
|
|
39
|
+
this._borderWidthMax = 4;
|
|
37
40
|
|
|
38
41
|
}
|
|
39
42
|
|
|
@@ -87,9 +90,13 @@ export class TileHelper {
|
|
|
87
90
|
const w = bounds.width * scaleX;
|
|
88
91
|
const h = bounds.height * scaleY;
|
|
89
92
|
|
|
90
|
-
|
|
93
|
+
const lineWidth = Math.min(
|
|
94
|
+
this._borderWidthMax,
|
|
95
|
+
Math.max( this._borderWidthMin, Math.min( displayW, displayH ) * this._borderWidthRatio )
|
|
96
|
+
);
|
|
97
|
+
|
|
91
98
|
ctx.strokeStyle = this._borderColor;
|
|
92
|
-
ctx.lineWidth =
|
|
99
|
+
ctx.lineWidth = lineWidth;
|
|
93
100
|
ctx.strokeRect( x, y, w, h );
|
|
94
101
|
|
|
95
102
|
}
|