Browse Source

update

master
guy 7 years ago
parent
commit
2ef3c1eacf
  1. 23
      bi/base.js
  2. 23
      dist/base.js
  3. 23
      dist/bundle.js
  4. 70
      dist/bundle.min.js

23
bi/base.js

@ -2425,6 +2425,10 @@ BI.Canvas = BI.inherit(BI.Widget, {
this._queue = [];
},
mounted: function () {
this.stroke();
},
_getContext: function () {
if (!this.ctx) {
this.ctx = this.canvas.getContext('2d');
@ -2439,11 +2443,11 @@ BI.Canvas = BI.inherit(BI.Widget, {
}
if (BI.isObject(key)) {
BI.each(key, function (k, v) {
self._queue.push({k: k, v: v});
self._queue.push({ k: k, v: v });
});
return;
}
this._queue.push({k: key, v: value});
this._queue.push({ k: key, v: value });
},
_line: function (x0, y0) {
@ -2509,20 +2513,19 @@ BI.Canvas = BI.inherit(BI.Widget, {
this._getContext().clearRect(0, 0, this.canvas.width, this.canvas.height);
},
stroke: function (callback) {
var self = this;
BI.nextTick(function () {
var ctx = self._getContext();
BI.each(self._queue, function (i, q) {
stroke: function () {
var ctx = this._getContext();
if(!ctx){
return false;
}
BI.each(this._queue, function (i, q) {
if (BI.isFunction(ctx[q.k])) {
ctx[q.k].apply(ctx, q.v);
} else {
ctx[q.k] = q.v;
}
});
self._queue = [];
callback && callback();
});
this._queue = [];
}
});
BI.shortcut("bi.canvas", BI.Canvas);/**

23
dist/base.js vendored

@ -2425,6 +2425,10 @@ BI.Canvas = BI.inherit(BI.Widget, {
this._queue = [];
},
mounted: function () {
this.stroke();
},
_getContext: function () {
if (!this.ctx) {
this.ctx = this.canvas.getContext('2d');
@ -2439,11 +2443,11 @@ BI.Canvas = BI.inherit(BI.Widget, {
}
if (BI.isObject(key)) {
BI.each(key, function (k, v) {
self._queue.push({k: k, v: v});
self._queue.push({ k: k, v: v });
});
return;
}
this._queue.push({k: key, v: value});
this._queue.push({ k: key, v: value });
},
_line: function (x0, y0) {
@ -2509,20 +2513,19 @@ BI.Canvas = BI.inherit(BI.Widget, {
this._getContext().clearRect(0, 0, this.canvas.width, this.canvas.height);
},
stroke: function (callback) {
var self = this;
BI.nextTick(function () {
var ctx = self._getContext();
BI.each(self._queue, function (i, q) {
stroke: function () {
var ctx = this._getContext();
if(!ctx){
return false;
}
BI.each(this._queue, function (i, q) {
if (BI.isFunction(ctx[q.k])) {
ctx[q.k].apply(ctx, q.v);
} else {
ctx[q.k] = q.v;
}
});
self._queue = [];
callback && callback();
});
this._queue = [];
}
});
BI.shortcut("bi.canvas", BI.Canvas);/**

23
dist/bundle.js vendored

@ -28166,6 +28166,10 @@ BI.Canvas = BI.inherit(BI.Widget, {
this._queue = [];
},
mounted: function () {
this.stroke();
},
_getContext: function () {
if (!this.ctx) {
this.ctx = this.canvas.getContext('2d');
@ -28180,11 +28184,11 @@ BI.Canvas = BI.inherit(BI.Widget, {
}
if (BI.isObject(key)) {
BI.each(key, function (k, v) {
self._queue.push({k: k, v: v});
self._queue.push({ k: k, v: v });
});
return;
}
this._queue.push({k: key, v: value});
this._queue.push({ k: key, v: value });
},
_line: function (x0, y0) {
@ -28250,20 +28254,19 @@ BI.Canvas = BI.inherit(BI.Widget, {
this._getContext().clearRect(0, 0, this.canvas.width, this.canvas.height);
},
stroke: function (callback) {
var self = this;
BI.nextTick(function () {
var ctx = self._getContext();
BI.each(self._queue, function (i, q) {
stroke: function () {
var ctx = this._getContext();
if(!ctx){
return false;
}
BI.each(this._queue, function (i, q) {
if (BI.isFunction(ctx[q.k])) {
ctx[q.k].apply(ctx, q.v);
} else {
ctx[q.k] = q.v;
}
});
self._queue = [];
callback && callback();
});
this._queue = [];
}
});
BI.shortcut("bi.canvas", BI.Canvas);/**

70
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save