Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
Victor Seiji Hariki 2023-02-15 00:03:16 -03:00
parent 978e96e3d7
commit c19b9f48b4

View file

@ -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();
};
}