Fix blurry overlay rendering when the pixel display ratio isn't 100% (#2204)

* support hi dpi overlay rendering

* Code review and make scaling ratio dynamic

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Andy Day
2025-01-25 09:37:49 +00:00
committed by GitHub
co-authored by Keavon Chambers
parent 9954e49530
commit 33ac141fb8
5 changed files with 122 additions and 4 deletions
+7
View File
@@ -352,6 +352,13 @@ impl EditorHandle {
self.dispatch(message);
}
/// Inform the overlays system of the current device pixel ratio
#[wasm_bindgen(js_name = setDevicePixelRatio)]
pub fn set_device_pixel_ratio(&self, ratio: f64) {
let message = OverlaysMessage::SetDevicePixelRatio { ratio };
self.dispatch(message);
}
/// Mouse movement within the screenspace bounds of the viewport
#[wasm_bindgen(js_name = onMouseMove)]
pub fn on_mouse_move(&self, x: f64, y: f64, mouse_keys: u8, modifiers: u8) {