Commit 7aabc8d7 authored by Xingyu Xu's avatar Xingyu Xu Committed by 马金花儿

fix zoom in mac (#46)

* fix zoom in mac
* reverse delta
parent e63eefc8
/*! /*!
* ==================================================== * ====================================================
* Kity Minder Core - v1.4.49 - 2018-04-02 * Kity Minder Core - v1.4.50 - 2018-09-17
* https://github.com/fex-team/kityminder-core * https://github.com/fex-team/kityminder-core
* GitHub: https://github.com/fex-team/kityminder-core.git * GitHub: https://github.com/fex-team/kityminder-core.git
* Copyright (c) 2018 Baidu FEX; Licensed BSD-3-Clause * Copyright (c) 2018 Baidu FEX; Licensed BSD-3-Clause
...@@ -7949,9 +7949,6 @@ _p[63] = { ...@@ -7949,9 +7949,6 @@ _p[63] = {
if (!e.originEvent.ctrlKey && !e.originEvent.metaKey) return; if (!e.originEvent.ctrlKey && !e.originEvent.metaKey) return;
var delta = e.originEvent.wheelDelta; var delta = e.originEvent.wheelDelta;
var me = this; var me = this;
if (!kity.Browser.mac) {
delta = -delta;
}
// 稀释 // 稀释
if (Math.abs(delta) > 100) { if (Math.abs(delta) > 100) {
clearTimeout(this._wheelZoomTimeout); clearTimeout(this._wheelZoomTimeout);
...@@ -7961,9 +7958,9 @@ _p[63] = { ...@@ -7961,9 +7958,9 @@ _p[63] = {
this._wheelZoomTimeout = setTimeout(function() { this._wheelZoomTimeout = setTimeout(function() {
var value; var value;
var lastValue = me.getPaper()._zoom || 1; var lastValue = me.getPaper()._zoom || 1;
if (delta < 0) { if (delta > 0) {
me.execCommand("zoomin"); me.execCommand("zoomin");
} else if (delta > 0) { } else if (delta < 0) {
me.execCommand("zoomout"); me.execCommand("zoomout");
} }
}, 100); }, 100);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>KityMinder Example</title> <title>KityMinder Example</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" >
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon"> <link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
<link rel="stylesheet" href="src/kityminder.css" rel="stylesheet"> <link rel="stylesheet" href="src/kityminder.css" rel="stylesheet">
...@@ -62,4 +62,4 @@ ...@@ -62,4 +62,4 @@
km.execCommand('hand'); km.execCommand('hand');
</script> </script>
</html> </html>
\ No newline at end of file
...@@ -165,11 +165,6 @@ define(function(require, exports, module) { ...@@ -165,11 +165,6 @@ define(function(require, exports, module) {
var delta = e.originEvent.wheelDelta; var delta = e.originEvent.wheelDelta;
var me = this; var me = this;
if (!kity.Browser.mac) {
delta = -delta;
}
// 稀释 // 稀释
if (Math.abs(delta) > 100) { if (Math.abs(delta) > 100) {
clearTimeout(this._wheelZoomTimeout); clearTimeout(this._wheelZoomTimeout);
...@@ -180,9 +175,9 @@ define(function(require, exports, module) { ...@@ -180,9 +175,9 @@ define(function(require, exports, module) {
this._wheelZoomTimeout = setTimeout(function() { this._wheelZoomTimeout = setTimeout(function() {
var value; var value;
var lastValue = me.getPaper()._zoom || 1; var lastValue = me.getPaper()._zoom || 1;
if (delta < 0) { if (delta > 0) {
me.execCommand('zoomin'); me.execCommand('zoomin');
} else if (delta > 0) { } else if (delta < 0) {
me.execCommand('zoomout'); me.execCommand('zoomout');
} }
}, 100); }, 100);
......
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