advent22/ui/src/components/rects/RectText.vue

36 lines
641 B
Vue
Raw Normal View History

2023-01-24 11:35:45 +00:00
<template>
<text
:x="rectangle.left + 0.5 * rectangle.width"
:y="rectangle.top + 0.5 * rectangle.height"
text-anchor="middle"
dominant-baseline="middle"
>
{{ text }}
</text>
</template>
<script lang="ts">
import { Vue, Options } from "vue-class-component";
import { Rectangle } from "./rectangles";
@Options({
props: {
rectangle: Rectangle,
text: String,
},
})
export default class RectText extends Vue {
private rectangle!: Rectangle;
private text!: string;
}
</script>
<style lang="scss" scoped>
text {
fill: red;
font-weight: bold;
font-size: 40px;
font-stretch: condensed;
}
</style>