-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Implemented a new Ellipse Component for drawing ellipse shapes in the Math Extension -The component supports custom properties such as center point, long axis, and short axis -Use the definitions and properties of the Vue Motion library to implement component functionality
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<script setup lang="ts"> | ||
import { defineProps } from 'vue' | ||
import { defineWidget } from '@vue-motion/core' | ||
import type { FigureMixin, FigureOptions } from './figure' | ||
import { figure } from './figure' | ||
export interface EllipseOptions extends FigureOptions { | ||
cx: number | ||
cy: number | ||
rx: number | ||
ry: number | ||
width?: number | ||
height?: number | ||
radius?: number | ||
} | ||
export type EllipseMixin = EllipseOptions & FigureMixin | ||
const props = defineProps<EllipseOptions>() | ||
const options = defineWidget(props) | ||
</script> | ||
|
||
<template> | ||
<ellipse | ||
v-bind="figure(options)" | ||
:cx="options.cx" | ||
:cy="options.cy" | ||
:rx="options.rx" | ||
:ry="options.ry" | ||
:width="options.width" | ||
:height="options.height" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters