Lf94/hidpi hovering fix (#5541)

* Fix hover highlights on HiDPI screens

* Fix flakey tests with new toolbar.exitSketch

* tsc && lint && fmt

* Disable pw electron thing again

* Fix test

---------

Co-authored-by: 49lf <ircsurfer33@gmail.com>
This commit is contained in:
Pierre Jacquier
2025-03-06 11:19:13 -05:00
committed by GitHub
parent 4e1b0daacb
commit 2696ddb996
9 changed files with 78 additions and 59 deletions

View File

@ -1447,11 +1447,17 @@ export class EngineCommandManager extends EventTarget {
commandId: string
}
settings: SettingsViaQueryString
width: number = 1337
height: number = 1337
streamDimensions = {
// Random defaults that are overwritten pretty much immediately
width: 1337,
height: 1337,
}
elVideo: HTMLVideoElement | null = null
/**
* Export intent traxcks the intent of the export. If it is null there is no
* Export intent tracks the intent of the export. If it is null there is no
* export in progress. Otherwise it is an enum value of the intent.
* Another export cannot be started if one is already in progress.
*/
@ -1554,15 +1560,14 @@ export class EngineCommandManager extends EventTarget {
return
}
this.width = width
this.height = height
this.streamDimensions = {
width,
height,
}
// If we already have an engine connection, just need to resize the stream.
if (this.engineConnection) {
this.handleResize({
streamWidth: width,
streamHeight: height,
})
this.handleResize(this.streamDimensions)
return
}
@ -1858,27 +1863,22 @@ export class EngineCommandManager extends EventTarget {
return
}
handleResize({
streamWidth,
streamHeight,
}: {
streamWidth: number
streamHeight: number
}) {
handleResize({ width, height }: { width: number; height: number }) {
if (!this.engineConnection?.isReady()) {
return
}
this.width = streamWidth
this.height = streamHeight
this.streamDimensions = {
width,
height,
}
const resizeCmd: EngineCommand = {
type: 'modeling_cmd_req',
cmd_id: uuidv4(),
cmd: {
type: 'reconfigure_stream',
width: streamWidth,
height: streamHeight,
...this.streamDimensions,
fps: 60,
},
}