Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resizing view breaking app on high DPI displays #5275

Merged
merged 8 commits into from
Feb 6, 2025
8 changes: 8 additions & 0 deletions src/lang/std/engineConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,8 @@ export class EngineCommandManager extends EventTarget {
commandId: string
}
settings: SettingsViaQueryString
width: number = 1337
height: number = 1337

/**
* Export intent traxcks the intent of the export. If it is null there is no
Expand Down Expand Up @@ -1511,6 +1513,9 @@ export class EngineCommandManager extends EventTarget {
return
}

this.width = width
this.height = height

// If we already have an engine connection, just need to resize the stream.
if (this.engineConnection) {
this.handleResize({
Expand Down Expand Up @@ -1823,6 +1828,9 @@ export class EngineCommandManager extends EventTarget {
return
}

this.width = streamWidth
this.height = streamHeight

const resizeCmd: EngineCommand = {
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
Expand Down
4 changes: 2 additions & 2 deletions src/lib/selections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,8 +819,8 @@ export async function sendSelectEventToEngine(
clientX: e.clientX,
clientY: e.clientY,
el,
streamWidth: el.clientWidth,
streamHeight: el.clientHeight,
streamWidth: engineCommandManager.width,
streamHeight: engineCommandManager.height,
})
const res = await engineCommandManager.sendSceneCommand({
type: 'modeling_cmd_req',
Expand Down
Loading