Remove will-change optimization after use

This commit is contained in:
Ophir LOJKINE 2019-01-17 16:48:47 +01:00
parent a980fa1b53
commit caf56bd503
2 changed files with 6 additions and 1 deletions

View file

@ -5,7 +5,6 @@ html, body, svg {
#canvas {
transform-origin: 0 0;
will-change: transform;
}
#menu {

View file

@ -278,10 +278,16 @@ function updateUnreadCount(m) {
Tools.messageHooks = [resizeCanvas, updateUnreadCount];
Tools.scale = 1.0;
var scaleTimeout = null;
Tools.setScale = function setScale(scale) {
if (isNaN(scale)) scale = 1;
scale = Math.max(0.1, Math.min(10, scale));
Tools.svg.style.willChange = 'transform';
Tools.svg.style.transform = 'scale(' + scale + ')';
clearTimeout(scaleTimeout);
scaleTimeout = setTimeout(function () {
Tools.svg.style.willChange = 'auto';
}, 1000);
Tools.scale = scale;
return scale;
}