mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
fix: fix parsing rgba error
This commit is contained in:
parent
fe69f7c0ad
commit
ce32a3240e
@ -324,8 +324,11 @@ export class Shape<
|
|||||||
return this._getCache(SHADOW_RGBA, this._getShadowRGBA);
|
return this._getCache(SHADOW_RGBA, this._getShadowRGBA);
|
||||||
}
|
}
|
||||||
_getShadowRGBA() {
|
_getShadowRGBA() {
|
||||||
if (this.hasShadow()) {
|
if (!this.hasShadow()) {
|
||||||
var rgba = Util.colorToRGBA(this.shadowColor());
|
return;
|
||||||
|
}
|
||||||
|
var rgba = Util.colorToRGBA(this.shadowColor());
|
||||||
|
if (rgba) {
|
||||||
return (
|
return (
|
||||||
'rgba(' +
|
'rgba(' +
|
||||||
rgba.r +
|
rgba.r +
|
||||||
|
@ -1229,6 +1229,11 @@ describe('Shape', function () {
|
|||||||
// reset shadow
|
// reset shadow
|
||||||
circle.shadowColor(null);
|
circle.shadowColor(null);
|
||||||
assert.equal(circle.getShadowRGBA(), undefined);
|
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 () {
|
it('scale should also effect shadow offset', function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user