forked from QinMing/attn-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SmallIcon.tsx
37 lines (34 loc) · 933 Bytes
/
SmallIcon.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from "react";
import {Image, View} from "react-native";
interface Prop {
faceID: any,
bounds: any,
img_src: any,
y: number,
scale: number,
}
export default class SmallIcon extends React.Component<Prop, {}> {
render() {
let {faceID, bounds, img_src, y, scale} = this.props;
return <View
key={faceID.toString() + '-' + y.toString()}
style={{
position: 'absolute',
width: bounds.size.width * scale,
height: bounds.size.height * scale,
left: bounds.origin.x + bounds.size.width * (0.5 - 0.5 * scale + 2 * (y + 1) * scale),
top: bounds.origin.y - bounds.size.height * (0.1 + scale),
transform: [
{perspective: 600},
]
}}>
<Image
source={img_src}
style={{
position: 'absolute',
width: bounds.size.width * scale,
height: bounds.size.width * scale,
}}/>
</View>;
}
}