mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 05:01:41 +08:00
fixed up fillStroke() logic in the Shape class
This commit is contained in:
parent
fb9f324cfb
commit
c17029d38e
13
dist/kinetic-core.js
vendored
13
dist/kinetic-core.js
vendored
@ -2173,17 +2173,12 @@ Kinetic.Shape.prototype = {
|
||||
context.fill();
|
||||
}
|
||||
|
||||
var stroke, strokeWidth;
|
||||
if(this.attrs.stroke !== undefined || this.attrs.strokeWidth !== undefined) {
|
||||
if(this.attrs.stroke === undefined) {
|
||||
stroke = 'black';
|
||||
}
|
||||
else if(this.attrs.strokeWidth === undefined) {
|
||||
strokeWidth = 2;
|
||||
}
|
||||
var stroke = this.attrs.stroke !== undefined ? this.attrs.stroke : 'black';
|
||||
var strokeWidth = this.attrs.strokeWidth !== undefined ? this.attrs.strokeWidth : 2;
|
||||
|
||||
context.lineWidth = this.attrs.strokeWidth === undefined ? 1 : this.attrs.strokeWidth;
|
||||
context.strokeStyle = this.attrs.stroke;
|
||||
context.lineWidth = strokeWidth;
|
||||
context.strokeStyle = stroke;
|
||||
context.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
13
src/Shape.js
13
src/Shape.js
@ -67,17 +67,12 @@ Kinetic.Shape.prototype = {
|
||||
context.fill();
|
||||
}
|
||||
|
||||
var stroke, strokeWidth;
|
||||
if(this.attrs.stroke !== undefined || this.attrs.strokeWidth !== undefined) {
|
||||
if(this.attrs.stroke === undefined) {
|
||||
stroke = 'black';
|
||||
}
|
||||
else if(this.attrs.strokeWidth === undefined) {
|
||||
strokeWidth = 2;
|
||||
}
|
||||
var stroke = this.attrs.stroke !== undefined ? this.attrs.stroke : 'black';
|
||||
var strokeWidth = this.attrs.strokeWidth !== undefined ? this.attrs.strokeWidth : 2;
|
||||
|
||||
context.lineWidth = this.attrs.strokeWidth === undefined ? 1 : this.attrs.strokeWidth;
|
||||
context.strokeStyle = this.attrs.stroke;
|
||||
context.lineWidth = strokeWidth;
|
||||
context.strokeStyle = stroke;
|
||||
context.stroke();
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user