File tree Expand file tree Collapse file tree 1 file changed +26
-19
lines changed Expand file tree Collapse file tree 1 file changed +26
-19
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <rect
3
- :x =" position.x - boxWidth / 2"
4
- :y =" position.y - boxHeight / 2 - 0.5"
5
- :width =" boxWidth"
6
- :height =" boxHeight"
7
- :fill =" colors.labelBackground"
8
- :stroke =" color"
9
- stroke-width =" 1.5"
10
- rx =" 6"
11
- />
12
- <text
13
- :x =" position.x"
14
- :y =" position.y"
15
- :style =" `font-family: monospace; font-size: ${fontSize}px; dominant-baseline: middle; text-anchor: middle; font-weight: 500;`"
16
- :fill =" color"
17
- >
18
- {{ text }}
19
- </text >
2
+ <g :transform =" `rotate(${-rotation}, ${position.x}, ${position.y})`" >
3
+ <rect
4
+ :x =" position.x - boxWidth / 2"
5
+ :y =" position.y - boxHeight / 2 - 0.5"
6
+ :width =" boxWidth"
7
+ :height =" boxHeight"
8
+ :fill =" colors.labelBackground"
9
+ :stroke =" color"
10
+ stroke-width =" 1.5"
11
+ rx =" 6"
12
+ />
13
+ <text
14
+ :x =" position.x"
15
+ :y =" position.y"
16
+ :style =" `font-family: monospace; font-size: ${fontSize}px; dominant-baseline: middle; text-anchor: middle; font-weight: 500;`"
17
+ :fill =" color"
18
+ >
19
+ {{ text }}
20
+ </text >
21
+ </g >
20
22
</template >
21
23
22
24
<script setup lang="ts">
@@ -32,9 +34,14 @@ const props = withDefaults(
32
34
size? : keyof typeof sizes ;
33
35
color? : Color ;
34
36
position? : PossibleVector2 ;
37
+ rotation? : number ;
35
38
text: string ;
36
39
}>(),
37
- { size: " normal" , position : () => new Vector2 () },
40
+ {
41
+ size: " normal" ,
42
+ position : () => new Vector2 (),
43
+ rotation: 0 ,
44
+ },
38
45
);
39
46
40
47
const fontSizes = {
You can’t perform that action at this time.
0 commit comments