From 3db0c5c9cca56b27b6cd9bd917285eb7c446d5a2 Mon Sep 17 00:00:00 2001 From: Josh Howenstine Date: Wed, 30 Oct 2024 06:55:14 -0700 Subject: [PATCH] feat: allow surface class radius to be overwritten by parent (#548) --- .../ui-components/src/components/Surface/Surface.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/@lightningjs/ui-components/src/components/Surface/Surface.js b/packages/@lightningjs/ui-components/src/components/Surface/Surface.js index 42921405b..476df526c 100644 --- a/packages/@lightningjs/ui-components/src/components/Surface/Surface.js +++ b/packages/@lightningjs/ui-components/src/components/Surface/Surface.js @@ -52,6 +52,10 @@ export default class Surface extends Base { return this.w; } + get _radius() { + return getMaxRoundRadius(this.style.radius, this.w, this.h); + } + _update() { this._updateLayout(); this._updateScale(); @@ -62,7 +66,7 @@ export default class Surface extends Base { texture: lng.Tools.getRoundRect( this.innerW - 2, // Reference the underscored values here in cause the h or w getters need to be overwritten for alignment - see Tile this.innerH - 2, - getMaxRoundRadius(this.style.radius, this.w, this.h), + this._radius, 0, null, true,