Skip to content

Commit 07166b0

Browse files
committed
Fix vml for the last optimization
1 parent 1e7a968 commit 07166b0

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/vml/Painter.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,21 @@ define(function (require) {
4040
this.resize();
4141

4242
// Modify storage
43-
var oldDelFromMap = storage.delFromMap;
44-
var oldAddToMap = storage.addToMap;
45-
storage.delFromMap = function (elId) {
46-
var el = storage.get(elId);
47-
48-
oldDelFromMap.call(storage, elId);
43+
var oldDelFromStorage = storage.delFromStorage;
44+
var oldAddToStorage = storage.addToStorage;
45+
storage.delFromStorage = function (el) {
46+
oldDelFromStorage.call(storage, el);
4947

5048
if (el) {
5149
el.onRemove && el.onRemove(vmlRoot);
5250
}
5351
};
5452

55-
storage.addToMap = function (el) {
53+
storage.addToStorage = function (el) {
5654
// Displayable already has a vml node
5755
el.onAdd && el.onAdd(vmlRoot);
5856

59-
oldAddToMap.call(storage, el);
57+
oldAddToStorage.call(storage, el);
6058
};
6159

6260
this._firstPaint = true;

src/vml/graphic.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if (!require('../core/env').canvasSupported) {
1313
var ZImage = require('../graphic/Image');
1414
var Text = require('../graphic/Text');
1515
var Path = require('../graphic/Path');
16+
var PathProxy = require('../core/PathProxy');
1617

1718
var Gradient = require('../graphic/Gradient');
1819

@@ -482,7 +483,7 @@ if (!require('../core/env').canvasSupported) {
482483
strokeEl.weight = lineWidth + 'px';
483484
}
484485

485-
var path = this.path;
486+
var path = this.path || (this.path = new PathProxy());
486487
if (this.__dirtyPath) {
487488
path.beginPath();
488489
this.buildPath(path, this.shape);

0 commit comments

Comments
 (0)