Skip to content

Commit

Permalink
fix: Retain resolution when switching rendering engines
Browse files Browse the repository at this point in the history
Issue: #81

The current resolution setting in the viewer was not preserved when changing between rendering engines (software, WebGL, WebGPU). Now, the selected resolution remains consistent across engine switches.
  • Loading branch information
tinyjin committed Dec 9, 2024
1 parent 19b65fa commit 335a87d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var filesList;
var filetype;
var filename;
var filedata;
var size = 800;
var renderer = 'sw';

//console output
Expand Down Expand Up @@ -240,6 +241,7 @@ function loadData(data, fileExtension) {
// FIXME: delay should be removed
setTimeout(async () => {
await player.load(data, fileExtension);
resize(size, size);
showAside();
createTabs();
showImageCanvas();
Expand Down Expand Up @@ -403,7 +405,7 @@ function onConsoleBottom(event) {

function onZoomSlider(event) {
var value = event.target.value;
var size = Math.floor(512 * (value / 100 + 0.25));
size = Math.floor(512 * (value / 100 + 0.25));

resize(size, size);
refreshZoomValue();
Expand Down

0 comments on commit 335a87d

Please sign in to comment.