mirror of
https://github.com/lovasoa/whitebophir
synced 2024-11-10 14:34:20 +00:00
Remove will-change optimization after use
This commit is contained in:
parent
a980fa1b53
commit
caf56bd503
2 changed files with 6 additions and 1 deletions
|
@ -5,7 +5,6 @@ html, body, svg {
|
|||
|
||||
#canvas {
|
||||
transform-origin: 0 0;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
#menu {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue