broadcast scaling parameters on ar change
This commit is contained in:
parent
a0d599ce2f
commit
3d8d8eb199
@ -107,10 +107,6 @@ export default class EventBus {
|
|||||||
eventBusCommand.function(commandData, context);
|
eventBusCommand.function(commandData, context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (context.commandId) {
|
|
||||||
const i = this.lastExecutedCommandIndex++ % this.lastExecutedCommandIds.length;
|
|
||||||
this.lastExecutedCommandIds[i] = context.commandId;
|
|
||||||
}
|
|
||||||
|
|
||||||
// preventing messages from flowing back to their original senders is
|
// preventing messages from flowing back to their original senders is
|
||||||
// CommsServer's job. EventBus does not have enough data for this decision.
|
// CommsServer's job. EventBus does not have enough data for this decision.
|
||||||
@ -119,6 +115,11 @@ export default class EventBus {
|
|||||||
if (!context.commandId) {
|
if (!context.commandId) {
|
||||||
context.commandId = crypto.randomUUID();
|
context.commandId = crypto.randomUUID();
|
||||||
}
|
}
|
||||||
|
if (context.commandId) {
|
||||||
|
const i = this.lastExecutedCommandIndex++ % this.lastExecutedCommandIds.length;
|
||||||
|
this.lastExecutedCommandIds[i] = context.commandId;
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.comms
|
this.comms
|
||||||
&& context?.origin !== CommsOrigin.Server
|
&& context?.origin !== CommsOrigin.Server
|
||||||
|
|||||||
@ -19,6 +19,8 @@ import { UwuiWindow } from './UwuiWindow';
|
|||||||
|
|
||||||
import { createApp } from 'vue';
|
import { createApp } from 'vue';
|
||||||
import SettingsWindowContent from '@components/SettingsWindowContent.vue';
|
import SettingsWindowContent from '@components/SettingsWindowContent.vue';
|
||||||
|
import { Ar } from '@src/common/interfaces/ArInterface';
|
||||||
|
import { Stretch } from '@src/common/interfaces/StretchInterface';
|
||||||
// import jsonEditorCSS from 'vanilla-jsoneditor/themes/jse-theme-dark.css?inline'
|
// import jsonEditorCSS from 'vanilla-jsoneditor/themes/jse-theme-dark.css?inline'
|
||||||
|
|
||||||
if (process.env.CHANNEL !== 'stable'){
|
if (process.env.CHANNEL !== 'stable'){
|
||||||
@ -93,6 +95,12 @@ class UI {
|
|||||||
function: (commandData, context) => {
|
function: (commandData, context) => {
|
||||||
this.createSettingsWindow(commandData?.initialState);
|
this.createSettingsWindow(commandData?.initialState);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'broadcast-scaling-params': {
|
||||||
|
function: (commandData: {effectiveZoom: {x: number, y: number}, lastAr: Ar, stretch: Stretch}, context) => {
|
||||||
|
console.warn('got scaling params:', commandData)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -495,8 +495,14 @@ class Resizer {
|
|||||||
try {
|
try {
|
||||||
const translate = this.computeOffsets(stretchFactors, options?.ar);
|
const translate = this.computeOffsets(stretchFactors, options?.ar);
|
||||||
this.applyCss(stretchFactors, translate);
|
this.applyCss(stretchFactors, translate);
|
||||||
|
|
||||||
|
this.eventBus.send('broadcast-scaling-params', {
|
||||||
|
effectiveZoom: {x: stretchFactors.xFactor, y: stretchFactors.yFactor},
|
||||||
|
lastAr: this.lastAr,
|
||||||
|
stretch: this.stretcher.stretch
|
||||||
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.logger.warn('setAr', 'error while applying CSS:', e);
|
this.logger.warn('applyScaling', 'error while applying CSS:', e);
|
||||||
// don't apply CSS if there's an error
|
// don't apply CSS if there's an error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user