added requestRedraw to node window (#3940)

This commit is contained in:
Florian Blasius 2023-11-16 06:49:49 +01:00 committed by GitHub
parent aeace4c4ed
commit 80bcdee646
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -71,6 +71,9 @@ export interface Window {
/** Hides the window, so that it is not visible anymore. */
hide(): void;
/** Issues a request to the windowing system to re-render the contents of the window. */
requestRedraw(): void;
}
/**

View file

@ -117,4 +117,10 @@ impl JsWindow {
height: size.height.floor() as u32,
});
}
/// Issues a request to the windowing system to re-render the contents of the window.
#[napi(js_name = "requestRedraw")]
pub fn request_redraw(&self) {
self.inner.request_redraw();
}
}