mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
Merge branch 'master' of github.com:konvajs/konva into master
This commit is contained in:
commit
25b3fe2db0
@ -324,8 +324,11 @@ export class Shape<
|
||||
return this._getCache(SHADOW_RGBA, this._getShadowRGBA);
|
||||
}
|
||||
_getShadowRGBA() {
|
||||
if (this.hasShadow()) {
|
||||
var rgba = Util.colorToRGBA(this.shadowColor());
|
||||
if (!this.hasShadow()) {
|
||||
return;
|
||||
}
|
||||
var rgba = Util.colorToRGBA(this.shadowColor());
|
||||
if (rgba) {
|
||||
return (
|
||||
'rgba(' +
|
||||
rgba.r +
|
||||
|
@ -1229,6 +1229,11 @@ describe('Shape', function () {
|
||||
// reset shadow
|
||||
circle.shadowColor(null);
|
||||
assert.equal(circle.getShadowRGBA(), undefined);
|
||||
|
||||
// illegal color
|
||||
circle.shadowColor('#0000f');
|
||||
assert.equal(circle.hasShadow(), true);
|
||||
assert.equal(circle.getShadowRGBA(), undefined);
|
||||
});
|
||||
|
||||
it('scale should also effect shadow offset', function () {
|
||||
|
Loading…
Reference in New Issue
Block a user