From 713163e31a6bfc5a560a94e91e1563f7b3f748fc Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Thu, 21 Dec 2023 13:25:27 +0100 Subject: [PATCH] Simplify scaling system --- examples/print.html | 2 +- examples/print.js | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/examples/print.html b/examples/print.html index 98f4c94fc..31a67c52f 100644 --- a/examples/print.html +++ b/examples/print.html @@ -16,7 +16,7 @@ - diff --git a/examples/print.js b/examples/print.js index db05e3923..9b17f377d 100644 --- a/examples/print.js +++ b/examples/print.js @@ -41,7 +41,7 @@ ol3d.setEnabled(true); document.getElementById('enable').addEventListener('click', () => ol3d.setEnabled(!ol3d.getEnabled())); -document.getElementById('printScale').addEventListener('change', evt => scaleGlobe(Number.parseFloat(evt.target.value))); +document.getElementById('resolutionScale').addEventListener('change', evt => ol3d.setResolutionScale(Number.parseFloat(evt.target.value))); function scalingOptions() { const printValue = document.querySelector('#printValue').value; @@ -56,19 +56,6 @@ function scalingOptions() { } autoDrawMask(scene, () => scalingOptions().scaling); -function scaleGlobe(value) { - /** - * @type {HTMLCanvasElement} - */ - const canvas = scene.canvas; - const currentScale = canvas.width / canvas.clientWidth; - if (Math.abs(currentScale - value) < 0.01) { - return; - } - canvas.width = canvas.clientWidth * value; - canvas.height = canvas.clientHeight * value; -} - window['takeScreenshot'] = async function() { const r = scalingOptions(); console.log(r);