Skip to content

Commit

Permalink
[Chg] 事件添加完毕
Browse files Browse the repository at this point in the history
  • Loading branch information
bobiscool committed Oct 24, 2017
1 parent aaae33d commit cb14933
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 27 deletions.
4 changes: 2 additions & 2 deletions example/pages/index/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Page({
this.wxCanvas.touchendDetect();
},
bindtap:function(e){
console.log(e);
// console.log(e);
this.wxCanvas.tapDetect(e);
},
bindlongpress:function(e){
console.log(e);
// console.log(e);
this.wxCanvas.longpressDetect(e);
},
onLoad: function () {
Expand Down
14 changes: 7 additions & 7 deletions example/utils/wxdraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -3417,7 +3417,7 @@ AniFragWrap.prototype = {
* @Author: Thunderball.Wu
* @Date: 2017-09-22 15:45:51
* @Last Modified by: Thunderball.Wu
* @Last Modified time: 2017-10-24 13:58:44
* @Last Modified time: 2017-10-24 14:05:11
* 在这里添加事件
*/

Expand Down Expand Up @@ -3463,11 +3463,11 @@ Shape.prototype = {
},
detect: function detect(x, y, type) {
//检查点击了谁
console.log('点中了吗', x, y, type);
console.log('点中了吗', this.Shape.detected(x, y));
// console.log('点中了吗',x,y,type);
// console.log('点中了吗',this.Shape.detected(x, y));
if (this.Shape.detected(x, y)) {
//console.log('点击')
console.log(this.type);
// console.log(this.type);
this._nowType = type;
this.bus.dispatch('getDetectedLayers', 'no', this._layerIndex);
} else {
Expand Down Expand Up @@ -3811,7 +3811,7 @@ Animation.prototype = {
* @Author: Thunderball.Wu
* @Date: 2017-09-21 13:47:34
* @Last Modified by: Thunderball.Wu
* @Last Modified time: 2017-10-24 14:02:04
* @Last Modified time: 2017-10-24 14:06:00
* 主要 引入对象
*
* 写给开发者的:
Expand Down Expand Up @@ -3970,9 +3970,9 @@ WxDraw.prototype = {
},
getDetectedLayers: function getDetectedLayers(layers) {
this.detectedLayers.push(layers); // 这个地方不能推一次 就 判断一次 应该全部推完了 之后再来判断
console.log(this.detectedLayers);
// console.log(this.detectedLayers);
if (this.detectedLayers.length == this.store.getLength() && Math.max.apply(null, this.detectedLayers) != -1) {
console.log('选取层级');
// console.log('选取层级');
this.store.find(Math.max.apply(null, this.detectedLayers)).getChoosed();
}

Expand Down
13 changes: 6 additions & 7 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,12 @@
- [x]矩阵变换
- [x] 层级修改
- [x] 事件
- [ ] touchstart
- [ ] touchmove
- [ ] touchend
- [ ] 拖拽事件
- [ ] move事件「与拖拽事件不一样。。move还有可能是动画运动的时候」
- [ ] tap事件
- [ ] longpress事件
- [x] touchstart
- [x] touchmove
- [x] touchend
- [x] 拖拽事件
- [x] tap事件
- [x] longpress事件
- [ ] ~划入划出~「划入划出是鼠标的事件吧」
- [ ] 编辑框
- 点击框选
Expand Down
14 changes: 7 additions & 7 deletions wxDraw/dist/wxdraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -3417,7 +3417,7 @@ AniFragWrap.prototype = {
* @Author: Thunderball.Wu
* @Date: 2017-09-22 15:45:51
* @Last Modified by: Thunderball.Wu
* @Last Modified time: 2017-10-24 13:58:44
* @Last Modified time: 2017-10-24 14:05:11
* 在这里添加事件
*/

Expand Down Expand Up @@ -3463,11 +3463,11 @@ Shape.prototype = {
},
detect: function detect(x, y, type) {
//检查点击了谁
console.log('点中了吗', x, y, type);
console.log('点中了吗', this.Shape.detected(x, y));
// console.log('点中了吗',x,y,type);
// console.log('点中了吗',this.Shape.detected(x, y));
if (this.Shape.detected(x, y)) {
//console.log('点击')
console.log(this.type);
// console.log(this.type);
this._nowType = type;
this.bus.dispatch('getDetectedLayers', 'no', this._layerIndex);
} else {
Expand Down Expand Up @@ -3811,7 +3811,7 @@ Animation.prototype = {
* @Author: Thunderball.Wu
* @Date: 2017-09-21 13:47:34
* @Last Modified by: Thunderball.Wu
* @Last Modified time: 2017-10-24 14:02:04
* @Last Modified time: 2017-10-24 14:06:00
* 主要 引入对象
*
* 写给开发者的:
Expand Down Expand Up @@ -3970,9 +3970,9 @@ WxDraw.prototype = {
},
getDetectedLayers: function getDetectedLayers(layers) {
this.detectedLayers.push(layers); // 这个地方不能推一次 就 判断一次 应该全部推完了 之后再来判断
console.log(this.detectedLayers);
// console.log(this.detectedLayers);
if (this.detectedLayers.length == this.store.getLength() && Math.max.apply(null, this.detectedLayers) != -1) {
console.log('选取层级');
// console.log('选取层级');
this.store.find(Math.max.apply(null, this.detectedLayers)).getChoosed();
}

Expand Down
8 changes: 4 additions & 4 deletions wxDraw/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: Thunderball.Wu
* @Date: 2017-09-21 13:47:34
* @Last Modified by: Thunderball.Wu
* @Last Modified time: 2017-10-24 14:02:04
* @Last Modified time: 2017-10-24 14:07:01
* 主要 引入对象
*
* 写给开发者的:
Expand Down Expand Up @@ -173,9 +173,9 @@ WxDraw.prototype = {
},
getDetectedLayers: function (layers) {
this.detectedLayers.push(layers);// 这个地方不能推一次 就 判断一次 应该全部推完了 之后再来判断
console.log(this.detectedLayers);
// console.log(this.detectedLayers);
if (this.detectedLayers.length == this.store.getLength() && Math.max.apply(null, this.detectedLayers) != -1) {
console.log('选取层级');
// console.log('选取层级');
this.store.find(Math.max.apply(null, this.detectedLayers)).getChoosed();
}

Expand All @@ -202,7 +202,7 @@ WxDraw.prototype = {
//相对增减
// console.log('相对增减');
_index = oldIndex + flag * parseInt(flag == -1 ? index.split('-')[1] : index.split('+')[1]);
console.log(_index);
// console.log(_index);
}
else {

Expand Down

0 comments on commit cb14933

Please sign in to comment.