mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2026-02-06 11:17:36 +00:00
Fix screenshot return in EJS_onSaveState (#1092)
* Fixed bug where a screenshot wasn't returned using EJS_onSaveState * Refactor takeScreenshot method to return a promise with screenshot data and format; update input element in HTML for better accessibility.
This commit is contained in:
parent
ce7472d264
commit
ad9586d266
@ -7040,10 +7040,12 @@ class EmulatorJS {
|
||||
}
|
||||
}
|
||||
|
||||
async takeScreenshot(source, format, upscale) {
|
||||
takeScreenshot(source, format, upscale) {
|
||||
return new Promise((resolve) => {
|
||||
this.screenshot((blob, format) => {
|
||||
resolve({ blob, format });
|
||||
this.screenshot(async (blob, returnFormat) => {
|
||||
const arrayBuffer = await blob.arrayBuffer();
|
||||
const uint8 = new Uint8Array(arrayBuffer);
|
||||
resolve({ screenshot: uint8, format: returnFormat });
|
||||
}, source, format, upscale);
|
||||
});
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@
|
||||
<br>
|
||||
</div>
|
||||
<div id="box">
|
||||
<input type = file id = input>
|
||||
<input type="file" id ="input" title="Upload" />
|
||||
Drag ROM file or click here
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user