| // CompoundPath to improve performance | ||
| var Path = require('./Path'); | ||
| module.exports = Path.extend({ | ||
| type: 'compound', | ||
| shape: { | ||
| paths: [] | ||
| }, | ||
| _updatePathDirty: function () { | ||
| var dirtyPath = this.__dirtyPath; | ||
| var paths = this.shape.paths; | ||
| for (var i = 0; i < paths.length; i++) { | ||
| // Mark as dirty if any subpath is dirty | ||
| dirtyPath = dirtyPath || paths[i].__dirtyPath; | ||
| } | ||
| this.__dirtyPath = dirtyPath; | ||
| this.__dirty = this.__dirty || dirtyPath; | ||
| }, | ||
| beforeBrush: function () { | ||
| this._updatePathDirty(); | ||
| }, | ||
| buildPath: function (ctx, shape) { | ||
| var paths = shape.paths; | ||
| for (var i = 0; i < paths.length; i++) { | ||
| paths[i].buildPath(ctx, paths[i].shape); | ||
| } | ||
| }, | ||
| afterBrush: function () { | ||
| var paths = this.shape.paths; | ||
| for (var i = 0; i < paths.length; i++) { | ||
| paths[i].__dirtyPath = false; | ||
| } | ||
| }, | ||
| getBoundingRect: function () { | ||
| this._updatePathDirty(); | ||
| return Path.getBoundingRect.call(this); | ||
| } | ||
| }); |
| // CompoundPath to improve performance | ||
| define(function (require) { | ||
| var Path = require('./Path'); | ||
| return Path.extend({ | ||
| type: 'compound', | ||
| shape: { | ||
| paths: [] | ||
| }, | ||
| _updatePathDirty: function () { | ||
| var dirtyPath = this.__dirtyPath; | ||
| var paths = this.shape.paths; | ||
| for (var i = 0; i < paths.length; i++) { | ||
| // Mark as dirty if any subpath is dirty | ||
| dirtyPath = dirtyPath || paths[i].__dirtyPath; | ||
| } | ||
| this.__dirtyPath = dirtyPath; | ||
| this.__dirty = this.__dirty || dirtyPath; | ||
| }, | ||
| beforeBrush: function () { | ||
| this._updatePathDirty(); | ||
| }, | ||
| buildPath: function (ctx, shape) { | ||
| var paths = shape.paths; | ||
| for (var i = 0; i < paths.length; i++) { | ||
| paths[i].buildPath(ctx, paths[i].shape); | ||
| } | ||
| }, | ||
| afterBrush: function () { | ||
| var paths = this.shape.paths; | ||
| for (var i = 0; i < paths.length; i++) { | ||
| paths[i].__dirtyPath = false; | ||
| } | ||
| }, | ||
| getBoundingRect: function () { | ||
| this._updatePathDirty(); | ||
| return Path.getBoundingRect.call(this); | ||
| } | ||
| }); | ||
| }); |
@@ -106,3 +106,3 @@ 'use strict'; | ||
| var t = curve.quadraticExtremum(y0, y1, y2); | ||
| if (t >=0 && t <= 1) { | ||
| if (t >= 0 && t <= 1) { | ||
| var w = 0; | ||
@@ -112,3 +112,3 @@ var y_ = curve.quadraticAt(y0, y1, y2, t); | ||
| var x_ = curve.quadraticAt(x0, x1, x2, roots[i]); | ||
| if (x_ > x) { | ||
| if (x_ < x) { // Quick reject | ||
| continue; | ||
@@ -127,3 +127,3 @@ } | ||
| var x_ = curve.quadraticAt(x0, x1, x2, roots[0]); | ||
| if (x_ > x) { | ||
| if (x_ < x) { // Quick reject | ||
| return 0; | ||
@@ -130,0 +130,0 @@ } |
@@ -21,5 +21,5 @@ /** | ||
| */ | ||
| var ZImage = function (opts) { | ||
| function ZImage(opts) { | ||
| Displayable.call(this, opts); | ||
| }; | ||
| } | ||
@@ -26,0 +26,0 @@ ZImage.prototype = { |
@@ -242,2 +242,3 @@ /** | ||
| }, | ||
| /** | ||
@@ -244,0 +245,0 @@ * @param {Object|string} key |
+0
-1
@@ -312,3 +312,2 @@ 'use strict'; | ||
| } | ||
| // TODO Use events ? | ||
| el.beforeBrush && el.beforeBrush(ctx); | ||
@@ -315,0 +314,0 @@ el.brush(ctx, false); |
@@ -428,3 +428,3 @@ // http://www.w3.org/TR/NOTE-VML | ||
| // Rewrite the original path method | ||
| Path.prototype.brush = function (vmlRoot) { | ||
| Path.prototype.brushVML = function (vmlRoot) { | ||
| var style = this.style; | ||
@@ -479,3 +479,3 @@ | ||
| Path.prototype.onRemoveFromStorage = function (vmlRoot) { | ||
| Path.prototype.onRemove = function (vmlRoot) { | ||
| remove(vmlRoot, this._vmlEl); | ||
@@ -485,3 +485,3 @@ this.removeRectText(vmlRoot); | ||
| Path.prototype.onAddToStorage = function (vmlRoot) { | ||
| Path.prototype.onAdd = function (vmlRoot) { | ||
| append(vmlRoot, this._vmlEl); | ||
@@ -501,3 +501,3 @@ this.appendRectText(vmlRoot); | ||
| // Rewrite the original path method | ||
| ZImage.prototype.brush = function (vmlRoot) { | ||
| ZImage.prototype.brushVML = function (vmlRoot) { | ||
| var style = this.style; | ||
@@ -708,3 +708,3 @@ var image = style.image; | ||
| ZImage.prototype.onRemoveFromStorage = function (vmlRoot) { | ||
| ZImage.prototype.onRemove = function (vmlRoot) { | ||
| remove(vmlRoot, this._vmlEl); | ||
@@ -719,3 +719,3 @@ | ||
| ZImage.prototype.onAddToStorage = function (vmlRoot) { | ||
| ZImage.prototype.onAdd = function (vmlRoot) { | ||
| append(vmlRoot, this._vmlEl); | ||
@@ -1006,3 +1006,3 @@ this.appendRectText(vmlRoot); | ||
| Text.prototype.brush = function (root) { | ||
| Text.prototype.brushVML = function (root) { | ||
| var style = this.style; | ||
@@ -1017,9 +1017,9 @@ if (style.text) { | ||
| Text.prototype.onRemoveFromStorage = function (vmlRoot) { | ||
| Text.prototype.onRemove = function (vmlRoot) { | ||
| this.removeRectText(vmlRoot); | ||
| }; | ||
| Text.prototype.onAddToStorage = function (vmlRoot) { | ||
| Text.prototype.onAdd = function (vmlRoot) { | ||
| this.appendRectText(vmlRoot); | ||
| }; | ||
| } |
@@ -51,3 +51,3 @@ /** | ||
| if (el) { | ||
| el.onRemoveFromStorage && el.onRemoveFromStorage(vmlRoot); | ||
| el.onRemove && el.onRemove(vmlRoot); | ||
| } | ||
@@ -58,3 +58,3 @@ }; | ||
| // Displayable already has a vml node | ||
| el.onAddToStorage && el.onAddToStorage(vmlRoot); | ||
| el.onAdd && el.onAdd(vmlRoot); | ||
@@ -94,3 +94,3 @@ oldAddToMap.call(storage, el); | ||
| if (!el.__alreadyNotVisible) { | ||
| el.onRemoveFromStorage(vmlRoot); | ||
| el.onRemove(vmlRoot); | ||
| } | ||
@@ -102,3 +102,3 @@ // Set as already invisible | ||
| if (el.__alreadyNotVisible) { | ||
| el.onAddToStorage(vmlRoot); | ||
| el.onAdd(vmlRoot); | ||
| } | ||
@@ -108,3 +108,3 @@ el.__alreadyNotVisible = false; | ||
| el.beforeBrush && el.beforeBrush(); | ||
| el.brush(vmlRoot); | ||
| (el.brushVML || el.brush)(vmlRoot); | ||
| el.afterBrush && el.afterBrush(); | ||
@@ -111,0 +111,0 @@ } |
+1
-1
@@ -31,3 +31,3 @@ /*! | ||
| */ | ||
| zrender.version = '3.0.4'; | ||
| zrender.version = '3.0.5'; | ||
@@ -34,0 +34,0 @@ /** |
+1
-1
| { | ||
| "name": "zrender", | ||
| "version": "3.0.4", | ||
| "version": "3.0.5", | ||
| "description": "A lightweight canvas library.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -107,3 +107,3 @@ define(function (require) { | ||
| var t = curve.quadraticExtremum(y0, y1, y2); | ||
| if (t >=0 && t <= 1) { | ||
| if (t >= 0 && t <= 1) { | ||
| var w = 0; | ||
@@ -113,3 +113,3 @@ var y_ = curve.quadraticAt(y0, y1, y2, t); | ||
| var x_ = curve.quadraticAt(x0, x1, x2, roots[i]); | ||
| if (x_ > x) { | ||
| if (x_ < x) { // Quick reject | ||
| continue; | ||
@@ -128,3 +128,3 @@ } | ||
| var x_ = curve.quadraticAt(x0, x1, x2, roots[0]); | ||
| if (x_ > x) { | ||
| if (x_ < x) { // Quick reject | ||
| return 0; | ||
@@ -131,0 +131,0 @@ } |
@@ -21,5 +21,5 @@ /** | ||
| */ | ||
| var ZImage = function (opts) { | ||
| function ZImage(opts) { | ||
| Displayable.call(this, opts); | ||
| }; | ||
| } | ||
@@ -26,0 +26,0 @@ ZImage.prototype = { |
@@ -242,2 +242,3 @@ /** | ||
| }, | ||
| /** | ||
@@ -244,0 +245,0 @@ * @param {Object|string} key |
+0
-1
@@ -312,3 +312,2 @@ /** | ||
| } | ||
| // TODO Use events ? | ||
| el.beforeBrush && el.beforeBrush(ctx); | ||
@@ -315,0 +314,0 @@ el.brush(ctx, false); |
@@ -428,3 +428,3 @@ // http://www.w3.org/TR/NOTE-VML | ||
| // Rewrite the original path method | ||
| Path.prototype.brush = function (vmlRoot) { | ||
| Path.prototype.brushVML = function (vmlRoot) { | ||
| var style = this.style; | ||
@@ -479,3 +479,3 @@ | ||
| Path.prototype.onRemoveFromStorage = function (vmlRoot) { | ||
| Path.prototype.onRemove = function (vmlRoot) { | ||
| remove(vmlRoot, this._vmlEl); | ||
@@ -485,3 +485,3 @@ this.removeRectText(vmlRoot); | ||
| Path.prototype.onAddToStorage = function (vmlRoot) { | ||
| Path.prototype.onAdd = function (vmlRoot) { | ||
| append(vmlRoot, this._vmlEl); | ||
@@ -501,3 +501,3 @@ this.appendRectText(vmlRoot); | ||
| // Rewrite the original path method | ||
| ZImage.prototype.brush = function (vmlRoot) { | ||
| ZImage.prototype.brushVML = function (vmlRoot) { | ||
| var style = this.style; | ||
@@ -708,3 +708,3 @@ var image = style.image; | ||
| ZImage.prototype.onRemoveFromStorage = function (vmlRoot) { | ||
| ZImage.prototype.onRemove = function (vmlRoot) { | ||
| remove(vmlRoot, this._vmlEl); | ||
@@ -719,3 +719,3 @@ | ||
| ZImage.prototype.onAddToStorage = function (vmlRoot) { | ||
| ZImage.prototype.onAdd = function (vmlRoot) { | ||
| append(vmlRoot, this._vmlEl); | ||
@@ -1006,3 +1006,3 @@ this.appendRectText(vmlRoot); | ||
| Text.prototype.brush = function (root) { | ||
| Text.prototype.brushVML = function (root) { | ||
| var style = this.style; | ||
@@ -1017,7 +1017,7 @@ if (style.text) { | ||
| Text.prototype.onRemoveFromStorage = function (vmlRoot) { | ||
| Text.prototype.onRemove = function (vmlRoot) { | ||
| this.removeRectText(vmlRoot); | ||
| }; | ||
| Text.prototype.onAddToStorage = function (vmlRoot) { | ||
| Text.prototype.onAdd = function (vmlRoot) { | ||
| this.appendRectText(vmlRoot); | ||
@@ -1024,0 +1024,0 @@ }; |
@@ -51,3 +51,3 @@ /** | ||
| if (el) { | ||
| el.onRemoveFromStorage && el.onRemoveFromStorage(vmlRoot); | ||
| el.onRemove && el.onRemove(vmlRoot); | ||
| } | ||
@@ -58,3 +58,3 @@ }; | ||
| // Displayable already has a vml node | ||
| el.onAddToStorage && el.onAddToStorage(vmlRoot); | ||
| el.onAdd && el.onAdd(vmlRoot); | ||
@@ -94,3 +94,3 @@ oldAddToMap.call(storage, el); | ||
| if (!el.__alreadyNotVisible) { | ||
| el.onRemoveFromStorage(vmlRoot); | ||
| el.onRemove(vmlRoot); | ||
| } | ||
@@ -102,3 +102,3 @@ // Set as already invisible | ||
| if (el.__alreadyNotVisible) { | ||
| el.onAddToStorage(vmlRoot); | ||
| el.onAdd(vmlRoot); | ||
| } | ||
@@ -108,3 +108,3 @@ el.__alreadyNotVisible = false; | ||
| el.beforeBrush && el.beforeBrush(); | ||
| el.brush(vmlRoot); | ||
| (el.brushVML || el.brush)(vmlRoot); | ||
| el.afterBrush && el.afterBrush(); | ||
@@ -111,0 +111,0 @@ } |
+1
-1
@@ -31,3 +31,3 @@ /*! | ||
| */ | ||
| zrender.version = '3.0.4'; | ||
| zrender.version = '3.0.5'; | ||
@@ -34,0 +34,0 @@ /** |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
870496
0.27%170
1.19%25537
0.29%