Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
parent
978e96e3d7
commit
c19b9f48b4
1 changed files with 13 additions and 0 deletions
13
js/webui.js
13
js/webui.js
|
@ -118,6 +118,19 @@
|
|||
data.image.resourceName || "External Resource",
|
||||
image
|
||||
);
|
||||
// Fit image on screen if too big
|
||||
const wr = image.width / window.innerWidth;
|
||||
const hr = image.height / window.innerHeight;
|
||||
const mr = Math.max(wr, hr);
|
||||
|
||||
if (mr > viewport.zoom) {
|
||||
viewport.zoom = mr * 1.3;
|
||||
viewport.transform(imageCollection.element);
|
||||
|
||||
toolbar._current_tool.redrawui &&
|
||||
toolbar._current_tool.redrawui();
|
||||
}
|
||||
|
||||
tools.stamp.enable();
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue