From 7439a70864d34c9eeac31712fde1b320f9ad4618 Mon Sep 17 00:00:00 2001 From: Blake Thomas Williams <49404493+btw17@users.noreply.github.com> Date: Fri, 10 Feb 2023 13:17:29 -0600 Subject: [PATCH] feat: updated flyout button to set border radius via static variable (#6838) --- core/flyout_button.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/flyout_button.ts b/core/flyout_button.ts index 63f19e7a0..c3ad6cdaa 100644 --- a/core/flyout_button.ts +++ b/core/flyout_button.ts @@ -32,6 +32,10 @@ export class FlyoutButton { /** The vertical margin around the text in the button. */ static TEXT_MARGIN_Y = 2; + + /** The radius of the flyout button's borders. */ + static BORDER_RADIUS = 4; + private readonly text_: string; private readonly position_: Coordinate; private readonly callbackKey_: string; @@ -102,8 +106,8 @@ export class FlyoutButton { shadow = dom.createSvgElement( Svg.RECT, { 'class': 'blocklyFlyoutButtonShadow', - 'rx': 4, - 'ry': 4, + 'rx': FlyoutButton.BORDER_RADIUS, + 'ry': FlyoutButton.BORDER_RADIUS, 'x': 1, 'y': 1, }, @@ -114,8 +118,8 @@ export class FlyoutButton { Svg.RECT, { 'class': this.isLabel_ ? 'blocklyFlyoutLabelBackground' : 'blocklyFlyoutButtonBackground', - 'rx': 4, - 'ry': 4, + 'rx': FlyoutButton.BORDER_RADIUS, + 'ry': FlyoutButton.BORDER_RADIUS, }, this.svgGroup_!);