Update src/engine/runtime.js
Browse files- src/engine/runtime.js +15 -2
src/engine/runtime.js
CHANGED
@@ -105,7 +105,11 @@ const ArgumentTypeMap = (() => {
|
|
105 |
}
|
106 |
};
|
107 |
map[ArgumentType.BOOLEAN] = {
|
108 |
-
check: 'Boolean'
|
|
|
|
|
|
|
|
|
109 |
};
|
110 |
map[ArgumentType.MATRIX] = {
|
111 |
shadow: {
|
@@ -1144,6 +1148,14 @@ class Runtime extends EventEmitter {
|
|
1144 |
return 'HATS_STARTED'
|
1145 |
}
|
1146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1147 |
/**
|
1148 |
* How rapidly we try to step threads by default, in ms.
|
1149 |
*/
|
@@ -2940,6 +2952,7 @@ class Runtime extends EventEmitter {
|
|
2940 |
this._stopThread(this.sequencer.activeThread);
|
2941 |
}
|
2942 |
// Remove all remaining threads from executing in the next tick.
|
|
|
2943 |
this.threads = [];
|
2944 |
this.threadMap.clear();
|
2945 |
}
|
@@ -3191,7 +3204,7 @@ class Runtime extends EventEmitter {
|
|
3191 |
if (this.stageWidth !== width || this.stageHeight !== height) {
|
3192 |
const deltaX = width - this.stageWidth;
|
3193 |
const deltaY = height - this.stageHeight;
|
3194 |
-
// Preserve monitor
|
3195 |
if (this._monitorState.size > 0) {
|
3196 |
const offsetX = deltaX / 2;
|
3197 |
const offsetY = deltaY / 2;
|
|
|
105 |
}
|
106 |
};
|
107 |
map[ArgumentType.BOOLEAN] = {
|
108 |
+
check: 'Boolean',
|
109 |
+
shadow: {
|
110 |
+
type: 'checkbox',
|
111 |
+
fieldName: 'CHECKBOX'
|
112 |
+
}
|
113 |
};
|
114 |
map[ArgumentType.MATRIX] = {
|
115 |
shadow: {
|
|
|
1148 |
return 'HATS_STARTED'
|
1149 |
}
|
1150 |
|
1151 |
+
/**
|
1152 |
+
* Event name for thread finishing.
|
1153 |
+
* @const {string}
|
1154 |
+
*/
|
1155 |
+
static get THREAD_FINISHED () {
|
1156 |
+
return 'THREAD_FINISHED'
|
1157 |
+
}
|
1158 |
+
|
1159 |
/**
|
1160 |
* How rapidly we try to step threads by default, in ms.
|
1161 |
*/
|
|
|
2952 |
this._stopThread(this.sequencer.activeThread);
|
2953 |
}
|
2954 |
// Remove all remaining threads from executing in the next tick.
|
2955 |
+
this.threads.forEach(v => v.status !== Thread.STATUS_DONE && this.emit(Runtime.THREAD_FINISHED, v))
|
2956 |
this.threads = [];
|
2957 |
this.threadMap.clear();
|
2958 |
}
|
|
|
3204 |
if (this.stageWidth !== width || this.stageHeight !== height) {
|
3205 |
const deltaX = width - this.stageWidth;
|
3206 |
const deltaY = height - this.stageHeight;
|
3207 |
+
// Preserve monitor location relative to the center of the stage
|
3208 |
if (this._monitorState.size > 0) {
|
3209 |
const offsetX = deltaX / 2;
|
3210 |
const offsetY = deltaY / 2;
|