mirror of
https://github.com/konvajs/konva.git
synced 2026-01-09 11:34:38 +08:00
refactored fillStroke() method
This commit is contained in:
9
dist/kinetic-core.js
vendored
9
dist/kinetic-core.js
vendored
@@ -2182,9 +2182,12 @@ Kinetic.Shape.prototype = {
|
||||
context.fill();
|
||||
}
|
||||
|
||||
if(this.attrs.stroke !== undefined || this.attrs.strokeWidth !== undefined) {
|
||||
var stroke = this.attrs.stroke !== undefined ? this.attrs.stroke : 'black';
|
||||
var strokeWidth = this.attrs.strokeWidth !== undefined ? this.attrs.strokeWidth : 2;
|
||||
var hasStroke = this.attrs.stroke !== undefined;
|
||||
var hasStrokeWidth = this.attrs.strokeWidth !== undefined && this.attrs.strokeWidth !== 0;
|
||||
|
||||
if(hasStroke || hasStrokeWidth) {
|
||||
var stroke = hasStroke ? this.attrs.stroke : 'black';
|
||||
var strokeWidth = hasStrokeWidth ? this.attrs.strokeWidth : 2;
|
||||
|
||||
context.lineWidth = strokeWidth;
|
||||
context.strokeStyle = stroke;
|
||||
|
||||
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user