mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Add comments about possible optimization of accessing of style properties.
This commit is contained in:
parent
1d6cfeeb9b
commit
b96cd4e1c8
1 changed files with 3 additions and 0 deletions
|
@ -213,6 +213,7 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
for (var i = 0, l = this._segments.length; i < l; i++) {
|
for (var i = 0, l = this._segments.length; i < l; i++) {
|
||||||
this._segments[i]._transformCoordinates(matrix, coords, true);
|
this._segments[i]._transformCoordinates(matrix, coords, true);
|
||||||
}
|
}
|
||||||
|
// TODO: Can't we access _style._fillColor, as we do in strokeBounds?
|
||||||
var fillColor = this.getFillColor(),
|
var fillColor = this.getFillColor(),
|
||||||
strokeColor = this.getStrokeColor();
|
strokeColor = this.getStrokeColor();
|
||||||
// Try calling transform on colors in case they are GradientColors.
|
// Try calling transform on colors in case they are GradientColors.
|
||||||
|
@ -1232,6 +1233,7 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
},
|
},
|
||||||
|
|
||||||
_hitTest: function(point, options, matrix) {
|
_hitTest: function(point, options, matrix) {
|
||||||
|
// TODO: Can't we access _style._strokeColor, as we do in strokeBounds?
|
||||||
var tolerance = options.tolerance || 0,
|
var tolerance = options.tolerance || 0,
|
||||||
radius = (options.stroke && this.getStrokeColor()
|
radius = (options.stroke && this.getStrokeColor()
|
||||||
? this.getStrokeWidth() / 2 : 0) + tolerance,
|
? this.getStrokeWidth() / 2 : 0) + tolerance,
|
||||||
|
@ -1389,6 +1391,7 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
||||||
if (!param.compound)
|
if (!param.compound)
|
||||||
ctx.beginPath();
|
ctx.beginPath();
|
||||||
|
|
||||||
|
// TODO: Can't we access _style._strokeColor, as we do in strokeBounds?
|
||||||
var fillColor = this.getFillColor(),
|
var fillColor = this.getFillColor(),
|
||||||
strokeColor = this.getStrokeColor(),
|
strokeColor = this.getStrokeColor(),
|
||||||
dashArray = this.getDashArray() || [], // TODO: Always defined?
|
dashArray = this.getDashArray() || [], // TODO: Always defined?
|
||||||
|
|
Loading…
Reference in a new issue