From 2f62ca702b7453199b2cc1179f3978bc3d4431b2 Mon Sep 17 00:00:00 2001 From: Josh Howenstine Date: Mon, 28 Oct 2024 12:29:55 -0700 Subject: [PATCH] feat: allow surface class radius to be overwritten by parent --- .../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,