File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
src/components/workspace/elements Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change 11Changelog
22
3+ # v3.2.4 [ 2024-12-26]
4+
5+ ## Patch Release
6+
7+ ### Fixes
8+ - Fixed square seat placement issue
9+
10+
311# v3.2.3 [ 2024-12-25]
412
513## Patch Release
Original file line number Diff line number Diff line change @@ -64,11 +64,14 @@ const Seat: React.FC<ISeatProps> = forwardRef(
6464 let value = ( + ref . current ?. getAttribute ( "cx" ) || x ) - seatLabelFontSize / 3.5 ;
6565 const labelLength = label ?. toString ( ) ?. length ?? 0 ;
6666 if ( labelLength >= 2 ) value -= ( seatLabelFontSize / 2.75 ) * ( labelLength - 1 ) ;
67+ if ( element . square ) value += seatSizeHalf ;
6768 return value ;
6869 } , [ ref , label , x ] ) ;
6970
7071 const textY = useMemo ( ( ) => {
71- return ( + ref . current ?. getAttribute ( "cy" ) || y ) + seatLabelFontSize / 2.75 ;
72+ let value = ( + ref . current ?. getAttribute ( "cy" ) || y ) + seatLabelFontSize / 2.75 ;
73+ if ( element . square ) value += seatSizeHalf ;
74+ return value ;
7275 } , [ ref , label , y ] ) ;
7376
7477 useEffect ( ( ) => {
@@ -139,15 +142,7 @@ const Seat: React.FC<ISeatProps> = forwardRef(
139142 return (
140143 < >
141144 { element . square ? (
142- < rect
143- x = { x - seatSizeHalf }
144- y = { y - seatSizeHalf }
145- height = { seatSize }
146- width = { seatSize }
147- rx = { 3 }
148- ry = { 3 }
149- { ...seatProps }
150- />
145+ < rect x = { x } y = { y } height = { seatSize } width = { seatSize } rx = { 3 } ry = { 3 } { ...seatProps } />
151146 ) : (
152147 < circle cx = { x } cy = { y } r = { seatSizeHalf } { ...seatProps } />
153148 ) }
You can’t perform that action at this time.
0 commit comments