makeEllipse()
属于@remotion/shapes包的一部分。
生成一个椭圆形的SVG路径。
示例
ellipse.tstsximport {makeEllipse } from "@remotion/shapes";const {path ,width ,height ,transformOrigin } =makeEllipse ({rx : 100,ry : 50,});console .log (path ); // M 100 0 a 100 100 0 1 0 1 0console .log (width ); // 200console .log (height ); // 100console .log (transformOrigin ); // '100 50'
ellipse.tstsximport {makeEllipse } from "@remotion/shapes";const {path ,width ,height ,transformOrigin } =makeEllipse ({rx : 100,ry : 50,});console .log (path ); // M 100 0 a 100 100 0 1 0 1 0console .log (width ); // 200console .log (height ); // 100console .log (transformOrigin ); // '100 50'
参数
rx
number
The radius of the ellipse on the X axis.
ry
number
The radius of the ellipse on the Y axis.
返回类型
path
A string that is suitable as an argument for d in a <path> element.
width
The width of the ellipse. Suitable for defining the viewBox of an <svg> tag.
height
The height of the ellipse. Suitable for defining the viewBox of an <svg> tag.
instructions
An array with SVG instructions. The type for a instruction can be seen by importing Instruction from @remotion/shapes.
transformOrigin
A string representing the point of origin if a shape should be rotated around itself.
If you want to rotate the shape around its center, use the transform-origin CSS property and pass this value, and also add transform-box: fill-box. This is the default for <Ellipse />.