1 |
d26c4168
|
Fantič
|
import { Box, HStack, Pressable, View, Text, Flex, IconButton } from 'native-base';
|
2 |
|
|
import React, { useEffect, useRef, useState } from 'react';
|
3 |
36ede89c
|
Fantič
|
import { StyleSheet, Dimensions, TouchableOpacity, GestureResponderEvent } from 'react-native';
|
4 |
7652bb26
|
Fantič
|
import { PanGestureHandler, PinchGestureHandler, State, TapGestureHandler, TouchableWithoutFeedback } from 'react-native-gesture-handler';
|
5 |
|
|
|
6 |
|
|
import { findNodeHandle, UIManager } from 'react-native';
|
7 |
|
|
|
8 |
8d384539
|
Fantič
|
import Animated, {
|
9 |
|
|
useAnimatedGestureHandler,
|
10 |
|
|
useAnimatedStyle,
|
11 |
|
|
useSharedValue,
|
12 |
|
|
} from 'react-native-reanimated';
|
13 |
28ab969f
|
Fantič
|
import { PlanImage, Room } from '../../types/plan';
|
14 |
7652bb26
|
Fantič
|
import Svg, { Path, SvgXml, Text as SvgText, G, Circle } from 'react-native-svg';
|
15 |
aac857cf
|
Fantič
|
|
16 |
bdedfcb4
|
Fantič
|
// @ts-ignore
|
17 |
36ede89c
|
Fantič
|
import pointInSvgPolygon from "point-in-svg-polygon"
|
18 |
d26c4168
|
Fantič
|
import { ExitfullscreenIcon, FullscreenIcon } from '../general/Icons';
|
19 |
bdedfcb4
|
Fantič
|
|
20 |
0733beb1
|
Fantič
|
|
21 |
36ede89c
|
Fantič
|
const CastlePlanView = (props: { mapImage: PlanImage, roomList: Room[], selectedRoom?: Room, fullScreenMode?: boolean, height?: number, setSelectedRoom?: (room: Room) => void }) => {
|
22 |
8d384539
|
Fantič
|
|
23 |
28ab969f
|
Fantič
|
const DEFAULT_SCALE = 1
|
24 |
|
|
const MIN_SCALE = 0.95
|
25 |
|
|
|
26 |
d26c4168
|
Fantič
|
const { mapImage, roomList, selectedRoom, height, setSelectedRoom } = props;
|
27 |
|
|
|
28 |
7652bb26
|
Fantič
|
|
29 |
d26c4168
|
Fantič
|
const [fullScreenMode, setFullScreen] = useState(false);
|
30 |
|
|
|
31 |
0733beb1
|
Fantič
|
|
32 |
|
|
useEffect(() => {
|
33 |
|
|
if (selectedRoom) {
|
34 |
|
|
zoomToRoom(selectedRoom)
|
35 |
|
|
}
|
36 |
|
|
}, [selectedRoom])
|
37 |
|
|
|
38 |
d26c4168
|
Fantič
|
useEffect(() => {
|
39 |
|
|
if (props.fullScreenMode) {
|
40 |
|
|
setFullScreen(props.fullScreenMode)
|
41 |
|
|
}
|
42 |
7652bb26
|
Fantič
|
}, [props.fullScreenMode])
|
43 |
d26c4168
|
Fantič
|
|
44 |
28ab969f
|
Fantič
|
|
45 |
|
|
const panRef = useRef<React.ReactElement>();
|
46 |
|
|
const pinchRef = useRef<React.ReactElement>();
|
47 |
bdedfcb4
|
Fantič
|
|
48 |
8d384539
|
Fantič
|
const svgRef = useRef<React.ReactElement>();
|
49 |
|
|
|
50 |
|
|
const translateX = useSharedValue(0);
|
51 |
|
|
const translateY = useSharedValue(0);
|
52 |
28ab969f
|
Fantič
|
const scale = useSharedValue(DEFAULT_SCALE);
|
53 |
8d384539
|
Fantič
|
|
54 |
28ab969f
|
Fantič
|
const onPanEvent = useAnimatedGestureHandler({
|
55 |
|
|
// handle one finger -> drag / move
|
56 |
36ede89c
|
Fantič
|
onStart: (event, ctx: any) => {
|
57 |
|
|
if (event.numberOfPointers === 1) {
|
58 |
|
|
ctx.startX = translateX.value;
|
59 |
|
|
ctx.startY = translateY.value;
|
60 |
|
|
}
|
61 |
28ab969f
|
Fantič
|
},
|
62 |
|
|
onActive: (event, ctx: any) => {
|
63 |
36ede89c
|
Fantič
|
if (event.numberOfPointers === 1) {
|
64 |
|
|
translateX.value = ctx.startX + event.translationX;
|
65 |
|
|
translateY.value = ctx.startY + event.translationY;
|
66 |
0733beb1
|
Fantič
|
|
67 |
|
|
console.log("xTranslate " + translateX.value + " yTranslate " + translateY.value)
|
68 |
36ede89c
|
Fantič
|
}
|
69 |
28ab969f
|
Fantič
|
},
|
70 |
|
|
});
|
71 |
aac857cf
|
Fantič
|
|
72 |
8d384539
|
Fantič
|
const onGestureEvent = useAnimatedGestureHandler({
|
73 |
08be9ecd
|
Fantič
|
onStart: (_, ctx: any) => {
|
74 |
|
|
ctx.startScale = scale.value;
|
75 |
|
|
},
|
76 |
|
|
onActive: (event: any, ctx: any) => {
|
77 |
|
|
// handle two fingers -> zoom + -
|
78 |
28ab969f
|
Fantič
|
if (event.numberOfPointers === 2) {
|
79 |
08be9ecd
|
Fantič
|
scale.value = ctx.startScale * event.scale;
|
80 |
|
|
}
|
81 |
|
|
},
|
82 |
|
|
onEnd: (event) => {
|
83 |
|
|
// handle two fingers -> zoom + -
|
84 |
|
|
if (event.numberOfPointers === 2) {
|
85 |
|
|
if (scale.value < MIN_SCALE) {
|
86 |
|
|
scale.value = MIN_SCALE;
|
87 |
8d384539
|
Fantič
|
}
|
88 |
08be9ecd
|
Fantič
|
// You may add additional logic for maximum scale if needed
|
89 |
d4c93958
|
Fantič
|
|
90 |
|
|
console.log("scale")
|
91 |
|
|
console.log(scale.value)
|
92 |
8d384539
|
Fantič
|
}
|
93 |
|
|
},
|
94 |
|
|
});
|
95 |
f220395e
|
Fantič
|
|
96 |
8d384539
|
Fantič
|
const animatedStyle = useAnimatedStyle(() => {
|
97 |
|
|
return {
|
98 |
|
|
transform: [
|
99 |
|
|
{ translateX: translateX.value },
|
100 |
|
|
{ translateY: translateY.value },
|
101 |
|
|
{ scale: scale.value },
|
102 |
|
|
],
|
103 |
|
|
};
|
104 |
|
|
});
|
105 |
aac857cf
|
Fantič
|
|
106 |
36ede89c
|
Fantič
|
|
107 |
0733beb1
|
Fantič
|
|
108 |
d4c93958
|
Fantič
|
function calculateStraightLineDistance(x1: number, y1: number, planX: number, planY: number) {
|
109 |
36ede89c
|
Fantič
|
// Apply scale and translations to both points
|
110 |
|
|
|
111 |
d26c4168
|
Fantič
|
const x2 = planX
|
112 |
|
|
const y2 = planY
|
113 |
36ede89c
|
Fantič
|
|
114 |
|
|
const x_distance = Math.abs(x1 - x2);
|
115 |
|
|
const y_distance = Math.abs(y1 - y2);
|
116 |
|
|
|
117 |
|
|
return x_distance + y_distance;
|
118 |
|
|
}
|
119 |
|
|
|
120 |
d26c4168
|
Fantič
|
const zoomOut = () => {
|
121 |
|
|
translateX.value = 0;
|
122 |
|
|
translateY.value = 0;
|
123 |
|
|
scale.value = DEFAULT_SCALE;
|
124 |
|
|
}
|
125 |
|
|
|
126 |
|
|
const zoomToRoom = (room: Room) => {
|
127 |
0733beb1
|
Fantič
|
const mapX = room.number_x
|
128 |
|
|
const mapY = room.number_y
|
129 |
7652bb26
|
Fantič
|
|
130 |
0733beb1
|
Fantič
|
const viewRatio = viewSize.width / viewSize.height;
|
131 |
|
|
const svgRatio = mapImage.viewBox.width / mapImage.viewBox.height;
|
132 |
7652bb26
|
Fantič
|
|
133 |
0733beb1
|
Fantič
|
let locationX = (mapX / mapImage.viewBox.width) * viewSize.width;
|
134 |
|
|
let locationY = (mapY / mapImage.viewBox.height) * viewSize.height;
|
135 |
7652bb26
|
Fantič
|
|
136 |
0733beb1
|
Fantič
|
if (svgRatio > viewRatio) {
|
137 |
|
|
// svg is spaced in the middle
|
138 |
|
|
// top down is filled
|
139 |
|
|
let xRatio = viewSize.width / mapImage.viewBox.width;
|
140 |
|
|
let yFilled = xRatio * mapImage.viewBox.height;
|
141 |
|
|
let offsetY = (viewSize.height - yFilled) / 2;
|
142 |
|
|
|
143 |
|
|
locationY = (mapY / mapImage.viewBox.height) * yFilled + offsetY;
|
144 |
|
|
} else if (svgRatio < viewRatio) {
|
145 |
|
|
let yRatio = viewSize.height / mapImage.viewBox.height;
|
146 |
|
|
let xFilled = yRatio * mapImage.viewBox.width;
|
147 |
|
|
let offsetX = (viewSize.width - xFilled) / 2;
|
148 |
|
|
|
149 |
|
|
locationX = (mapX / mapImage.viewBox.width) * xFilled + offsetX;
|
150 |
|
|
}
|
151 |
7652bb26
|
Fantič
|
|
152 |
0733beb1
|
Fantič
|
const scaleValue = 3
|
153 |
|
|
|
154 |
|
|
scale.value= scaleValue
|
155 |
|
|
|
156 |
|
|
const offsetX = (viewSize.width / 2 - locationX) * (scaleValue - 1);
|
157 |
|
|
const offsetY = (viewSize.height / 2 - locationY) * (scaleValue - 1);
|
158 |
|
|
|
159 |
|
|
// Apply the translation including the offset
|
160 |
|
|
translateX.value = viewSize.width / 2 - locationX + offsetX;
|
161 |
|
|
translateY.value = viewSize.height / 2 - locationY + offsetY;
|
162 |
d26c4168
|
Fantič
|
}
|
163 |
|
|
|
164 |
|
|
const handleFullScreenPressed = () => {
|
165 |
7652bb26
|
Fantič
|
if (scale.value != DEFAULT_SCALE || translateX.value != 0 || translateY.value != 0) {
|
166 |
0733beb1
|
Fantič
|
// console.log("todo zoom out")
|
167 |
d26c4168
|
Fantič
|
zoomOut()
|
168 |
|
|
}
|
169 |
|
|
else {
|
170 |
0733beb1
|
Fantič
|
// console.log("Toggling fullscreen")
|
171 |
d26c4168
|
Fantič
|
setFullScreen && setFullScreen(!fullScreenMode)
|
172 |
|
|
}
|
173 |
|
|
}
|
174 |
36ede89c
|
Fantič
|
|
175 |
|
|
const handleSvgPress = (event: GestureResponderEvent) => {
|
176 |
9222f70c
|
Fantič
|
let locationX = event.nativeEvent.locationX
|
177 |
|
|
let locationY = event.nativeEvent.locationY
|
178 |
36ede89c
|
Fantič
|
|
179 |
9222f70c
|
Fantič
|
// console.log("view size:")
|
180 |
|
|
// console.log("x " + viewSize.width + " y " + viewSize.height)
|
181 |
50044675
|
Fantič
|
|
182 |
0733beb1
|
Fantič
|
const viewRatio = viewSize.width / viewSize.height
|
183 |
9222f70c
|
Fantič
|
// console.log("ratio: " + viewSize.width / viewSize.height)
|
184 |
|
|
// console.log("svg size:")
|
185 |
|
|
// console.log("x " + mapImage.viewBox.width + " y " + mapImage.viewBox.height)
|
186 |
50044675
|
Fantič
|
const svgRatio = mapImage.viewBox.width / mapImage.viewBox.height
|
187 |
9222f70c
|
Fantič
|
// console.log("ratio: " + mapImage.viewBox.width / mapImage.viewBox.height)
|
188 |
d4c93958
|
Fantič
|
|
189 |
|
|
|
190 |
0733beb1
|
Fantič
|
let mapX = (locationX / viewSize.width) * mapImage.viewBox.width
|
191 |
|
|
let mapY = (locationY / viewSize.height) * mapImage.viewBox.height
|
192 |
|
|
|
193 |
|
|
console.log("clicked: x " + locationX + " y " + locationY)
|
194 |
9222f70c
|
Fantič
|
|
195 |
0733beb1
|
Fantič
|
if (svgRatio > viewRatio) {
|
196 |
50044675
|
Fantič
|
// svg is spaced in the middle
|
197 |
|
|
// top down is filled
|
198 |
9222f70c
|
Fantič
|
let xRatio = viewSize.width / mapImage.viewBox.width
|
199 |
|
|
let yFilled = xRatio * mapImage.viewBox.height
|
200 |
|
|
let offsetY = (viewSize.height - yFilled) / 2
|
201 |
d4c93958
|
Fantič
|
|
202 |
9222f70c
|
Fantič
|
mapY = ((locationY - offsetY) / yFilled) * mapImage.viewBox.height
|
203 |
50044675
|
Fantič
|
}
|
204 |
0733beb1
|
Fantič
|
else if (svgRatio < viewRatio) {
|
205 |
50044675
|
Fantič
|
// svg is spaced in the center
|
206 |
|
|
// left right is filled
|
207 |
9222f70c
|
Fantič
|
let yRatio = viewSize.height / mapImage.viewBox.height
|
208 |
|
|
let xFilled = yRatio * mapImage.viewBox.width
|
209 |
|
|
let offsetX = (viewSize.width - xFilled) / 2
|
210 |
d4c93958
|
Fantič
|
|
211 |
9222f70c
|
Fantič
|
mapX = ((locationX - offsetX) / xFilled) * mapImage.viewBox.width
|
212 |
50044675
|
Fantič
|
}
|
213 |
d4c93958
|
Fantič
|
|
214 |
|
|
// Check if the touch event is within the bounds of a room
|
215 |
|
|
let clickedRoom: Room | undefined = undefined
|
216 |
36ede89c
|
Fantič
|
|
217 |
d4c93958
|
Fantič
|
const maxNumberDistance = 100
|
218 |
bdedfcb4
|
Fantič
|
|
219 |
d4c93958
|
Fantič
|
let minDistance = Number.MAX_VALUE
|
220 |
bdedfcb4
|
Fantič
|
|
221 |
d4c93958
|
Fantič
|
for (let i = 0; i < roomList.length; i++) {
|
222 |
|
|
const room: Room = roomList[i]
|
223 |
|
|
if (room.in_plan) {
|
224 |
|
|
// TODO
|
225 |
|
|
// console.log()
|
226 |
0733beb1
|
Fantič
|
// console.log("Room + " + room.id + " x: " + room.number_x + " y: " + room.number_y)
|
227 |
36ede89c
|
Fantič
|
|
228 |
d4c93958
|
Fantič
|
const currentDistance = calculateStraightLineDistance(room.number_x, room.number_y, mapX, mapY)
|
229 |
36ede89c
|
Fantič
|
|
230 |
d4c93958
|
Fantič
|
if (currentDistance < minDistance) {
|
231 |
|
|
minDistance = currentDistance
|
232 |
|
|
clickedRoom = room
|
233 |
|
|
}
|
234 |
|
|
}
|
235 |
|
|
};
|
236 |
bdedfcb4
|
Fantič
|
|
237 |
d4c93958
|
Fantič
|
console.log()
|
238 |
|
|
console.log('Room clicked with id:', clickedRoom?.id);
|
239 |
|
|
console.log("x " + clickedRoom?.number_x + " y " + clickedRoom?.number_y)
|
240 |
|
|
console.log(minDistance)
|
241 |
|
|
console.log("translated clicked: x " + mapX + " y " + mapY)
|
242 |
d26c4168
|
Fantič
|
|
243 |
d4c93958
|
Fantič
|
if (clickedRoom && minDistance < maxNumberDistance) {
|
244 |
|
|
// TODO
|
245 |
5cee436e
|
Fantič
|
|
246 |
d4c93958
|
Fantič
|
// Perform any actions you need with the clicked room
|
247 |
36ede89c
|
Fantič
|
|
248 |
d4c93958
|
Fantič
|
// TODO fix -> point recognition
|
249 |
|
|
setSelectedRoom && setSelectedRoom(clickedRoom)
|
250 |
|
|
} else {
|
251 |
|
|
console.log("no room found")
|
252 |
|
|
}
|
253 |
|
|
console.log("")
|
254 |
bdedfcb4
|
Fantič
|
};
|
255 |
5cee436e
|
Fantič
|
|
256 |
d4c93958
|
Fantič
|
const [viewSize, setViewSize] = useState({ height: 0, width: 0 });
|
257 |
|
|
|
258 |
|
|
useEffect(() => {
|
259 |
|
|
setViewSize({
|
260 |
|
|
width: fullScreenMode ?
|
261 |
|
|
Dimensions.get('window').width - 20 : // full screen
|
262 |
|
|
Dimensions.get('window').width - 20, // not full screen
|
263 |
|
|
height: fullScreenMode ?
|
264 |
|
|
Dimensions.get('window').height - 122.5 : // full scren
|
265 |
0733beb1
|
Fantič
|
Dimensions.get('window').height - 350, // not full screen
|
266 |
d4c93958
|
Fantič
|
})
|
267 |
|
|
}, [fullScreenMode])
|
268 |
|
|
|
269 |
d26c4168
|
Fantič
|
|
270 |
aac857cf
|
Fantič
|
return (
|
271 |
8d384539
|
Fantič
|
// container
|
272 |
d26c4168
|
Fantič
|
<View
|
273 |
d4c93958
|
Fantič
|
height={viewSize.height}
|
274 |
|
|
width={viewSize.width}
|
275 |
5cee436e
|
Fantič
|
// @ts-ignore
|
276 |
|
|
style={
|
277 |
|
|
fullScreenMode ? {
|
278 |
d26c4168
|
Fantič
|
position: "absolute",
|
279 |
|
|
top: -230,
|
280 |
|
|
left: 0,
|
281 |
|
|
zIndex: 1000,
|
282 |
7652bb26
|
Fantič
|
backgroundColor: "white",
|
283 |
5cee436e
|
Fantič
|
}
|
284 |
|
|
:
|
285 |
d26c4168
|
Fantič
|
{
|
286 |
|
|
overflow: "hidden",
|
287 |
|
|
}
|
288 |
7a3ad946
|
Fantič
|
}
|
289 |
|
|
borderColor={"light.300"}
|
290 |
|
|
borderRadius={10}
|
291 |
d26c4168
|
Fantič
|
borderWidth={fullScreenMode ? 0 : 1}
|
292 |
08be9ecd
|
Fantič
|
>
|
293 |
d26c4168
|
Fantič
|
{/* control panel */}
|
294 |
0733beb1
|
Fantič
|
<Flex direction="row" alignItems="center" justify="flex-end" style={{ height: 50, width: 100, top: fullScreenMode ? 10 : 0, right: fullScreenMode ? 20 : 15, position: "absolute", zIndex: 5 }}>
|
295 |
d26c4168
|
Fantič
|
<Pressable padding={1.5} backgroundColor={"#654B07"} borderRadius={5} marginRight={selectedRoom ? 1 : -2} onPress={handleFullScreenPressed}>
|
296 |
|
|
<FullscreenIcon color="white" />
|
297 |
|
|
</Pressable>
|
298 |
|
|
{
|
299 |
|
|
selectedRoom &&
|
300 |
7652bb26
|
Fantič
|
<Pressable padding={1.5} backgroundColor={"#654B07"} borderRadius={5} marginRight={-2} onPress={() => { zoomToRoom(selectedRoom) }}>
|
301 |
d26c4168
|
Fantič
|
<ExitfullscreenIcon color="white" />
|
302 |
|
|
</Pressable>
|
303 |
|
|
}
|
304 |
|
|
|
305 |
|
|
</Flex>
|
306 |
08be9ecd
|
Fantič
|
|
307 |
28ab969f
|
Fantič
|
<PinchGestureHandler
|
308 |
|
|
ref={pinchRef}
|
309 |
|
|
// @ts-ignore
|
310 |
|
|
onGestureEvent={onGestureEvent}
|
311 |
|
|
simultaneousHandlers={[svgRef, panRef]}>
|
312 |
d4c93958
|
Fantič
|
<Animated.View style={[{ flex: 1 }, animatedStyle]}>
|
313 |
28ab969f
|
Fantič
|
<PanGestureHandler
|
314 |
|
|
ref={panRef}
|
315 |
|
|
simultaneousHandlers={[svgRef, pinchRef]}
|
316 |
|
|
onGestureEvent={onPanEvent}
|
317 |
bdedfcb4
|
Fantič
|
onHandlerStateChange={(nativeEvent: any) => {
|
318 |
|
|
if (nativeEvent.state === State.END) {
|
319 |
|
|
console.log(nativeEvent)
|
320 |
|
|
}
|
321 |
|
|
}}
|
322 |
8d384539
|
Fantič
|
>
|
323 |
28ab969f
|
Fantič
|
<Animated.View style={[{
|
324 |
|
|
flex: 1,
|
325 |
d4c93958
|
Fantič
|
}]}>
|
326 |
28ab969f
|
Fantič
|
<Svg
|
327 |
bdedfcb4
|
Fantič
|
id="svgMap"
|
328 |
d4c93958
|
Fantič
|
onPress={handleSvgPress}
|
329 |
28ab969f
|
Fantič
|
>
|
330 |
|
|
{mapImage && mapImage.viewBox &&
|
331 |
|
|
// background image
|
332 |
|
|
<SvgXml
|
333 |
|
|
xml={mapImage.svg}
|
334 |
|
|
width={"100%"}
|
335 |
|
|
height={"100%"}
|
336 |
d4c93958
|
Fantič
|
viewBox={`${0} ${0} ${mapImage.viewBox.width} ${mapImage.viewBox.height}`}
|
337 |
0733beb1
|
Fantič
|
// onLayout={(event) => {
|
338 |
|
|
// setSvgDimensions({
|
339 |
|
|
// width: event.nativeEvent.layout.width,
|
340 |
|
|
// height: event.nativeEvent.layout.height,
|
341 |
|
|
// });
|
342 |
|
|
// }}
|
343 |
7652bb26
|
Fantič
|
>
|
344 |
|
|
</SvgXml>
|
345 |
08be9ecd
|
Fantič
|
}
|
346 |
|
|
|
347 |
28ab969f
|
Fantič
|
{mapImage && roomList && roomList.length > 0 &&
|
348 |
bdedfcb4
|
Fantič
|
|
349 |
|
|
roomList.map((room, index) => {
|
350 |
08be9ecd
|
Fantič
|
if (!room.in_plan) {
|
351 |
|
|
return
|
352 |
|
|
}
|
353 |
|
|
return (
|
354 |
bdedfcb4
|
Fantič
|
<Path
|
355 |
|
|
id={"roomList_" + index.toString()}
|
356 |
|
|
d={room.svg_path} // The path data defining the shape of the room
|
357 |
|
|
fill={selectedRoom && room.id == selectedRoom.id ? "#E6F7FF" : "white"} // Fill the room shape with no color
|
358 |
|
|
stroke="#66B2FF" // Outline color
|
359 |
|
|
strokeWidth={0.3} // Outline width
|
360 |
|
|
fillOpacity={selectedRoom && room.id == selectedRoom.id ? 1 : 0.2}
|
361 |
|
|
/>
|
362 |
08be9ecd
|
Fantič
|
)
|
363 |
bdedfcb4
|
Fantič
|
})}
|
364 |
|
|
|
365 |
7652bb26
|
Fantič
|
|
366 |
|
|
|
367 |
bdedfcb4
|
Fantič
|
{mapImage && roomList && roomList.length > 0 &&
|
368 |
8d384539
|
Fantič
|
|
369 |
bdedfcb4
|
Fantič
|
roomList.map((room) => {
|
370 |
|
|
if (!room.in_plan) {
|
371 |
|
|
return
|
372 |
|
|
}
|
373 |
|
|
return (
|
374 |
d26c4168
|
Fantič
|
< SvgText
|
375 |
bdedfcb4
|
Fantič
|
x={room.number_x} // Adjust the x-coordinate based on your room data
|
376 |
|
|
y={room.number_y} // Adjust the y-coordinate based on your room data
|
377 |
|
|
fill="red" // Text color
|
378 |
|
|
fontSize={8} // Font size
|
379 |
|
|
textAnchor="middle" // Center the text horizontally
|
380 |
|
|
fontStyle='italic'
|
381 |
|
|
vectorEffect='non-scaling-stroke' // Helps prevent stroke from scaling
|
382 |
|
|
>
|
383 |
|
|
{room.id}
|
384 |
d26c4168
|
Fantič
|
</SvgText>
|
385 |
bdedfcb4
|
Fantič
|
)
|
386 |
|
|
})}
|
387 |
7652bb26
|
Fantič
|
|
388 |
28ab969f
|
Fantič
|
</Svg>
|
389 |
|
|
</Animated.View>
|
390 |
|
|
</PanGestureHandler>
|
391 |
8d384539
|
Fantič
|
</Animated.View>
|
392 |
bdedfcb4
|
Fantič
|
</PinchGestureHandler >
|
393 |
d26c4168
|
Fantič
|
</View >
|
394 |
aac857cf
|
Fantič
|
);
|
395 |
8d384539
|
Fantič
|
};
|
396 |
|
|
|
397 |
|
|
export default CastlePlanView;
|