laymur 0.17.2 → 0.17.4
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.
|
@@ -122,13 +122,9 @@ class UIFullscreenLayer extends UILayer {
|
|
|
122
122
|
return result.set(near, direction);
|
|
123
123
|
}
|
|
124
124
|
_private_handleWindowInput(event, pointerFunctionName, signal) {
|
|
125
|
-
const rect = event.target instanceof HTMLElement
|
|
126
|
-
? event.target.getBoundingClientRect()
|
|
127
|
-
: null;
|
|
125
|
+
const rect = event.target instanceof HTMLElement ? event.target.getBoundingClientRect() : null;
|
|
128
126
|
const x = rect ? event.clientX - rect.left : event.clientX;
|
|
129
|
-
const y = rect
|
|
130
|
-
? rect.bottom - event.clientY
|
|
131
|
-
: window.innerHeight - event.clientY;
|
|
127
|
+
const y = rect ? rect.bottom - event.clientY : window.innerHeight - event.clientY;
|
|
132
128
|
const scale = this.resizePolicy.calculateScale(window.innerWidth, window.innerHeight);
|
|
133
129
|
const scaledX = x * scale;
|
|
134
130
|
const scaledY = y * scale;
|
|
@@ -23,6 +23,7 @@ export declare abstract class UILayer implements UIPlaneElement {
|
|
|
23
23
|
private readonly signalOrientationChangedInternal;
|
|
24
24
|
private readonly signalModeChangedInternal;
|
|
25
25
|
private readonly signalRenderingInternal;
|
|
26
|
+
private readonly signalResizedInternal;
|
|
26
27
|
constructor(options: Partial<UILayerOptions>);
|
|
27
28
|
/** X coordinate in world units (always 0 for layers) */
|
|
28
29
|
get x(): number;
|
|
@@ -42,6 +43,8 @@ export declare abstract class UILayer implements UIPlaneElement {
|
|
|
42
43
|
get signalModeChanged(): FerrsignView2<UILayerMode, UILayer>;
|
|
43
44
|
/** Signal fired during rendering */
|
|
44
45
|
get signalRendering(): FerrsignView3<WebGLRenderer, number, UILayer>;
|
|
46
|
+
/** Signal fired when layer resized */
|
|
47
|
+
get signalResized(): FerrsignView3<number, number, UILayer>;
|
|
45
48
|
/** Updates visibility and interactivity mode */
|
|
46
49
|
set mode(value: UILayerMode);
|
|
47
50
|
protected resizeInternal(width: number, height: number): void;
|
|
@@ -18,6 +18,7 @@ class UILayer {
|
|
|
18
18
|
this._private_signalOrientationChangedInternal = new Ferrsign2();
|
|
19
19
|
this._private_signalModeChangedInternal = new Ferrsign2();
|
|
20
20
|
this._private_signalRenderingInternal = new Ferrsign3();
|
|
21
|
+
this._private_signalResizedInternal = new Ferrsign3();
|
|
21
22
|
if (options.width !== undefined) {
|
|
22
23
|
assertValidPositiveNumber(options.width, "UILayer.constructor.options.width");
|
|
23
24
|
}
|
|
@@ -83,6 +84,10 @@ class UILayer {
|
|
|
83
84
|
get signalRendering() {
|
|
84
85
|
return this._private_signalRenderingInternal;
|
|
85
86
|
}
|
|
87
|
+
/** Signal fired when layer resized */
|
|
88
|
+
get signalResized() {
|
|
89
|
+
return this._private_signalResizedInternal;
|
|
90
|
+
}
|
|
86
91
|
/** Updates visibility and interactivity mode */
|
|
87
92
|
set mode(value) {
|
|
88
93
|
if (value !== this._private_modeInternal) {
|
|
@@ -94,6 +99,7 @@ class UILayer {
|
|
|
94
99
|
this._private_solverWrapperInternal.suggestVariableValue(this.wVariable, width);
|
|
95
100
|
this._private_solverWrapperInternal.suggestVariableValue(this.hVariable, height);
|
|
96
101
|
this._private_sceneWrapperInternal.resize(width, height);
|
|
102
|
+
this._private_signalResizedInternal.emit(width, height, this);
|
|
97
103
|
const orientation = width > height ? UIOrientation.HORIZONTAL : UIOrientation.VERTICAL;
|
|
98
104
|
if (orientation !== this._private_orientationInternal) {
|
|
99
105
|
this._private_orientationInternal = orientation;
|