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 1
1
Changelog
2
2
3
+ # v3.2.4 [ 2024-12-26]
4
+
5
+ ## Patch Release
6
+
7
+ ### Fixes
8
+ - Fixed square seat placement issue
9
+
10
+
3
11
# v3.2.3 [ 2024-12-25]
4
12
5
13
## Patch Release
Original file line number Diff line number Diff line change @@ -64,11 +64,14 @@ const Seat: React.FC<ISeatProps> = forwardRef(
64
64
let value = ( + ref . current ?. getAttribute ( "cx" ) || x ) - seatLabelFontSize / 3.5 ;
65
65
const labelLength = label ?. toString ( ) ?. length ?? 0 ;
66
66
if ( labelLength >= 2 ) value -= ( seatLabelFontSize / 2.75 ) * ( labelLength - 1 ) ;
67
+ if ( element . square ) value += seatSizeHalf ;
67
68
return value ;
68
69
} , [ ref , label , x ] ) ;
69
70
70
71
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 ;
72
75
} , [ ref , label , y ] ) ;
73
76
74
77
useEffect ( ( ) => {
@@ -139,15 +142,7 @@ const Seat: React.FC<ISeatProps> = forwardRef(
139
142
return (
140
143
< >
141
144
{ 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 } />
151
146
) : (
152
147
< circle cx = { x } cy = { y } r = { seatSizeHalf } { ...seatProps } />
153
148
) }
You can’t perform that action at this time.
0 commit comments