diff --git a/src/common/components/mock-components/front-rich-components/buttonBar/buttonBar.tsx b/src/common/components/mock-components/front-rich-components/buttonBar/buttonBar.tsx index efeddd01..798713b5 100644 --- a/src/common/components/mock-components/front-rich-components/buttonBar/buttonBar.tsx +++ b/src/common/components/mock-components/front-rich-components/buttonBar/buttonBar.tsx @@ -10,6 +10,7 @@ import { splitCSVContentIntoRows, } from '@/common/utils/active-element-selector.utils'; import { useGroupShapeProps } from '../../mock-components.utils'; +import { useResizeOnFontSizeChange } from '../../front-text-components/front-text-hooks/resize-fontsize-change.hook'; const buttonBarShapeSizeRestrictions: ShapeSizeRestrictions = { minWidth: 200, @@ -49,13 +50,11 @@ export const ButtonBarShape = forwardRef((props, ref) => { const csvData = splitCSVContentIntoRows(text); const headers = extractCSVHeaders(csvData[0]); const tabLabels = headers.map(header => header.text); - + const verticalPadding = 8; const dynamicTabWidth = restrictedWidth / tabLabels.length; - const { stroke, strokeStyle, fill, textColor } = useShapeProps( - otherProps, - BASIC_SHAPE - ); + const { stroke, strokeStyle, fill, textColor, fontSize, fontVariant } = + useShapeProps(otherProps, BASIC_SHAPE); const activeTab = otherProps?.activeElement ?? 0; @@ -65,6 +64,7 @@ export const ButtonBarShape = forwardRef((props, ref) => { shapeType, ref ); + useResizeOnFontSizeChange(id, { x, y }, text, fontSize, fontVariant); return ( @@ -72,7 +72,7 @@ export const ButtonBarShape = forwardRef((props, ref) => { ((props, ref) => { /> diff --git a/src/pods/canvas/model/shape-other-props.utils.ts b/src/pods/canvas/model/shape-other-props.utils.ts index 8ad7a6d3..b06f61ac 100644 --- a/src/pods/canvas/model/shape-other-props.utils.ts +++ b/src/pods/canvas/model/shape-other-props.utils.ts @@ -109,6 +109,8 @@ export const generateDefaultOtherProps = ( textColor: BASIC_SHAPE.DEFAULT_FILL_TEXT, strokeStyle: [], activeElement: 0, + fontSize: FONT_SIZE_VALUES.NORMALTEXT, + fontVariant: `${INPUT_SHAPE.DEFAULT_FONT_VARIANT}`, }; case 'largeArrow': return {