Skip to content

Commit

Permalink
add sub tag <rect-shape> to <draw-node>. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Apr 23, 2024
1 parent 7f5416b commit b39005e
Show file tree
Hide file tree
Showing 4 changed files with 1,521 additions and 1,368 deletions.
42 changes: 42 additions & 0 deletions Assets/Script/Lib/Dora/en/jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,43 @@ class Polygon {
borderColor?: number;
}

class Rectangle {
/*
* The width of the rectangle.
*/
width: number;

/*
* The height of the rectangle.
*/
height: number;

/**
* The center X position of the rectangle.
*/
centerX?: number;

/**
* The center Y position of the rectangle.
*/
centerY?: number;

/*
* The fill color of the rectangle in format 0xffffffff (ARGB, default is white).
*/
fillColor?: number;

/**
* The width of the border (default is 0).
*/
borderWidth?: number;

/**
* The color of the border in format 0xffffffff (ARGB, default is white).
*/
borderColor?: number;
}

class Verts {
/*
* The list of vertices and their colors in format 0xffffffff (ARGB).
Expand Down Expand Up @@ -1455,6 +1492,11 @@ interface IntrinsicElements {
* Can only be used as a child element of `<draw-node>`.
*/
'segment-shape': Segment;
/**
* Draws a rectangle defined by width and height with a specified fill color and border.
* Can only be used as a child element of `<draw-node>`.
*/
'rect-shape': Rectangle;
/**
* Draws a polygon defined by a list of vertices with a specified fill color and border.
* Can only be used as a child element of `<draw-node>`.
Expand Down
41 changes: 41 additions & 0 deletions Assets/Script/Lib/Dora/zh-Hans/jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,43 @@ class Polygon {
borderColor?: number;
}

class Rectangle {
/*
* 矩形的长。
*/
width: number;

/*
* 矩形的宽。
*/
height: number;

/**
* 矩形的中心点的X坐标.
*/
centerX?: number;

/**
* 矩形的中心点的Y坐标.
*/
centerY?: number;

/*
* 矩形的填充颜色(默认为白色)。
*/
fillColor?: number;

/**
* 边框的宽度(默认为0)。
*/
borderWidth?: number;

/**
* 边框的颜色(默认为白色)。
*/
borderColor?: number;
}

class Verts {
/*
* 包含要绘制的顶点及其颜色的列表,颜色格式为0xffffffff(ARGB)。
Expand Down Expand Up @@ -1456,6 +1493,10 @@ interface IntrinsicElements {
* 用指定的半径和颜色绘制两点之间的线段。只能作为`<draw-node>`的子标签来使用。
*/
'segment-shape': Segment;
/**
* 绘制由长和宽定义的矩形,具有指定的填充颜色和边框。只能作为`<draw-node>`的子标签来使用。
*/
'rect-shape': Rectangle;
/**
* 绘制由顶点列表定义的多边形,具有指定的填充颜色和边框。只能作为`<draw-node>`的子标签来使用。
*/
Expand Down
Loading

0 comments on commit b39005e

Please sign in to comment.