Commit ada20c7f authored by shiyunjie's avatar shiyunjie

update viewer

parent c072b64e
...@@ -109,12 +109,12 @@ See https://github.com/adobe-type-tools/cmap-resources ...@@ -109,12 +109,12 @@ See https://github.com/adobe-type-tools/cmap-resources
document.addEventListener("touchmove", (e) => { document.addEventListener("touchmove", (e) => {
if (e.scale !== 1 && isiOSXZ ) { if (e.scale !== 1 && isiOSXZ ) {
e.preventDefault(); //e.preventDefault();
} }
}, { passive: false }); }, { passive: false });
viewer.addEventListener("touchstart", (e) => { viewer.addEventListener("touchstart", (e) => {
e.preventDefault(); //e.preventDefault();
if (e.touches.length > 1) { if (e.touches.length > 1) {
startX = (e.touches[0].pageX + e.touches[1].pageX) / 2; startX = (e.touches[0].pageX + e.touches[1].pageX) / 2;
startY = (e.touches[0].pageY + e.touches[1].pageY) / 2; startY = (e.touches[0].pageY + e.touches[1].pageY) / 2;
...@@ -122,7 +122,7 @@ See https://github.com/adobe-type-tools/cmap-resources ...@@ -122,7 +122,7 @@ See https://github.com/adobe-type-tools/cmap-resources
} else { } else {
initialPinchDistance = 0; initialPinchDistance = 0;
} }
}); },false);
viewer.addEventListener("touchmove", (e) => { viewer.addEventListener("touchmove", (e) => {
console.log('viewer_touchmove') console.log('viewer_touchmove')
...@@ -137,7 +137,7 @@ See https://github.com/adobe-type-tools/cmap-resources ...@@ -137,7 +137,7 @@ See https://github.com/adobe-type-tools/cmap-resources
viewer.style.transform = `scale(${pinchScale})`; viewer.style.transform = `scale(${pinchScale})`;
viewer.style.transformOrigin = `${originX}px ${originY}px`; viewer.style.transformOrigin = `${originX}px ${originY}px`;
}); },false);
viewer.addEventListener("touchend", (e) => { viewer.addEventListener("touchend", (e) => {
if (initialPinchDistance <= 0) { return; } if (initialPinchDistance <= 0) { return; }
...@@ -153,7 +153,7 @@ See https://github.com/adobe-type-tools/cmap-resources ...@@ -153,7 +153,7 @@ See https://github.com/adobe-type-tools/cmap-resources
container.scrollTop += dy * (pinchScale - 1); container.scrollTop += dy * (pinchScale - 1);
reset(); reset();
}); },false);
} }
enablePinchZoom(); enablePinchZoom();
/* if(!isWeixin){ /* if(!isWeixin){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment