Skip to content

Commit

Permalink
fix jsx APIs. [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Apr 25, 2024
1 parent 104b7e7 commit 6800da7
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 34 deletions.
8 changes: 4 additions & 4 deletions Assets/Script/Lib/Dora/en/dora.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2711,11 +2711,11 @@ class Node extends Object {
/** Whether the node has children. */
readonly hasChildren: boolean;

/** The children of the node as an Array object, could be nil. */
readonly children: Array;
/** The children of the node as an Array object, could be undefined. */
readonly children?: Array;

/** The parent node of the node. */
readonly parent: Node;
/** The parent node of the node, could be undefined. */
readonly parent?: Node;

/** The bounding box of the node as a Rect object. */
readonly boundingBox: Rect;
Expand Down
16 changes: 8 additions & 8 deletions Assets/Script/Lib/Dora/en/jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,12 @@ class Dot {
/**
* The X position of the dot.
*/
x: number;
x?: number;

/**
* The Y position of the dot.
*/
y: number;
y?: number;

/**
* The radius of the dot.
Expand Down Expand Up @@ -469,12 +469,12 @@ class Segment {
}

class Polygon {
/*
/**
* The vertices of the polygon.
*/
verts: dora.Vec2.Type[];

/*
/**
* The fill color of the polygon in format 0xffffffff (ARGB, default is white).
*/
fillColor?: number;
Expand All @@ -491,12 +491,12 @@ class Polygon {
}

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

/*
/**
* The height of the rectangle.
*/
height: number;
Expand All @@ -511,7 +511,7 @@ class Rectangle {
*/
centerY?: number;

/*
/**
* The fill color of the rectangle in format 0xffffffff (ARGB, default is white).
*/
fillColor?: number;
Expand All @@ -528,7 +528,7 @@ class Rectangle {
}

class Verts {
/*
/**
* The list of vertices and their colors in format 0xffffffff (ARGB).
*/
verts: [vert: dora.Vec2.Type, color: number][];
Expand Down
8 changes: 4 additions & 4 deletions Assets/Script/Lib/Dora/zh-Hans/dora.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2714,11 +2714,11 @@ class Node extends Object {
/** 节点是否有子节点。 */
readonly hasChildren: boolean;

/** 节点的子节点,为Array对象,可能为nil。 */
readonly children: Array;
/** 节点的子节点,为Array对象,可能为undefined。 */
readonly children?: Array;

/** 节点的父节点。 */
readonly parent: Node;
/** 节点的父节点,,可能为undefined。 */
readonly parent?: Node;

/** 节点的边界框,为Rect对象。 */
readonly boundingBox: Rect;
Expand Down
32 changes: 16 additions & 16 deletions Assets/Script/Lib/Dora/zh-Hans/jsx.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,22 +416,22 @@ class Model extends Playable {

class Dot {
/**
* 点的X坐标位置
* 圆点的X坐标位置
*/
x: number;
x?: number;

/**
* 点的Y坐标位置
* 圆点的Y坐标位置
*/
y: number;
y?: number;

/**
* 点的半径
* 圆点的半径
*/
radius: number;

/**
* 点的颜色,格式为0xffffffff(ARGB),默认为白色。
* 圆点的颜色,格式为0xffffffff(ARGB),默认为白色。
*/
color?: number;
}
Expand Down Expand Up @@ -469,13 +469,13 @@ class Segment {
}

class Polygon {
/*
/**
* 多边形的顶点。
*/
verts: dora.Vec2.Type[];

/*
* 多边形的填充颜色(默认为白色)
/**
* 多边形的填充颜色,格式为0xffffffff(ARGB),默认为白色
*/
fillColor?: number;

Expand All @@ -485,18 +485,18 @@ class Polygon {
borderWidth?: number;

/**
* 边框的颜色(默认为白色)
* 边框的颜色,格式为0xffffffff(ARGB),默认为白色
*/
borderColor?: number;
}

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

/*
/**
* 矩形的宽。
*/
height: number;
Expand All @@ -511,8 +511,8 @@ class Rectangle {
*/
centerY?: number;

/*
* 矩形的填充颜色(默认为白色)
/**
* 矩形的填充颜色,格式为0xffffffff(ARGB),默认为白色
*/
fillColor?: number;

Expand All @@ -522,13 +522,13 @@ class Rectangle {
borderWidth?: number;

/**
* 边框的颜色(默认为白色)
* 边框的颜色,格式为0xffffffff(ARGB),默认为白色
*/
borderColor?: number;
}

class Verts {
/*
/**
* 包含要绘制的顶点及其颜色的列表,颜色格式为0xffffffff(ARGB)。
*/
verts: [vert: dora.Vec2.Type, color: number][];
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Lib/dora-x.lua
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ do -- 290
do -- 306
local dot = child.props -- 310
node:drawDot( -- 311
dora.Vec2(dot.x, dot.y), -- 312
dora.Vec2(dot.x or 0, dot.y or 0), -- 312
dot.radius, -- 313
dora.Color(dot.color or 4294967295) -- 314
) -- 314
Expand Down
1 change: 1 addition & 0 deletions Source/Physics/PhysicsWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ bool PhysicsWorld::init() {
_filters[i].groupIndex = i;
_filters[i].categoryBits = 1 << i;
_filters[i].maskBits = 0;
setShouldContact(i, i, true);
}
Node::scheduleFixedUpdate();
return true;
Expand Down
2 changes: 1 addition & 1 deletion Tools/dora-jsx/dora-x.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ let getDrawNode: (this: void, enode: React.Element) => dora.DrawNode.Type;
case 'dot-shape': {
const dot = child.props as JSX.Dot;
node.drawDot(
dora.Vec2(dot.x, dot.y),
dora.Vec2(dot.x ?? 0, dot.y ?? 0),
dot.radius,
dora.Color(dot.color ?? 0xffffffff)
);
Expand Down

0 comments on commit 6800da7

Please sign in to comment.