ice-render 1.0.1 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/types/FrameManager.d.ts +10 -8
- package/dist/types/ICE.d.ts +2 -4
- package/dist/types/control-panel/transform-controls/ResizeControl.d.ts +10 -6
- package/dist/types/control-panel/transform-controls/RotateControl.d.ts +0 -4
- package/dist/types/event/ICEEventTarget.d.ts +7 -7
- package/dist/types/graphic/ICEComponent.d.ts +9 -2
- package/dist/types/graphic/ICEPath.d.ts +1 -4
- package/dist/types/graphic/container/ICEGroup.d.ts +3 -4
- package/dist/types/graphic/link/ICELinkSlot.d.ts +6 -5
- package/dist/types/graphic/link/ICELinkSlotManager.d.ts +3 -2
- package/dist/types/graphic/shape/ICECircle.d.ts +2 -2
- package/dist/types/graphic/shape/ICEEllipse.d.ts +1 -4
- package/dist/types/graphic/shape/ICEIsogon.d.ts +1 -3
- package/dist/types/graphic/shape/ICEStar.d.ts +1 -4
- package/dist/types/graphic/text/ICEText.d.ts +1 -0
- package/dist/types/renderer/CanvasRenderer.d.ts +1 -3
- package/dist/types/util/ImageCache.d.ts +4 -2
- package/package.json +1 -1
|
@@ -5,22 +5,26 @@ import ICERect from '../../graphic/shape/ICERect';
|
|
|
5
5
|
* - 调整尺寸的操作手柄不能独立存在,只能依附在某个宿主对象上。
|
|
6
6
|
* - 此手柄只能调整尺寸,不能实现翻转
|
|
7
7
|
*
|
|
8
|
-
* TODO: 补全 props 配置项
|
|
9
|
-
* {
|
|
10
|
-
* direction: 改变的方向,共有3个可选的值: x/y/both
|
|
11
|
-
* position: 手柄在变换矩形4个边上的位置,共有8个:lt/t/rt/r/rb/b/lb/l
|
|
12
|
-
* }
|
|
13
8
|
*/
|
|
14
9
|
export default class ResizeControl extends ICERect {
|
|
10
|
+
/**
|
|
11
|
+
* props:
|
|
12
|
+
* {
|
|
13
|
+
* direction: 改变的方向,共有3个可选的值: x/y/both
|
|
14
|
+
* position: 手柄在变换矩形4个边上的位置,共有8个:lt/t/rt/r/rb/b/lb/l
|
|
15
|
+
* quadrant: 当前所在的象限
|
|
16
|
+
* }
|
|
17
|
+
* @param props
|
|
18
|
+
*/
|
|
15
19
|
constructor(props: any);
|
|
16
20
|
protected initEvents(): void;
|
|
17
21
|
/**
|
|
18
|
-
* 围绕几何中心点调整宽高。
|
|
19
22
|
* @param evt
|
|
20
23
|
*/
|
|
21
24
|
private resizeEvtHandler;
|
|
22
25
|
/**
|
|
23
26
|
* @overwrite
|
|
27
|
+
* @method moveGlobalPosition
|
|
24
28
|
* ResizeControl 不能自由移动自己的位置,自能在X轴、Y轴,以及矩形的2条对角线上移动位置。
|
|
25
29
|
*
|
|
26
30
|
* 在全局空间(canvas)中移动指定的位移。
|
|
@@ -56,13 +56,6 @@ declare abstract class ICEEventTarget {
|
|
|
56
56
|
* @returns
|
|
57
57
|
*/
|
|
58
58
|
off(eventName: string, fn: Function, scope?: any): void;
|
|
59
|
-
/**
|
|
60
|
-
* @method once
|
|
61
|
-
* 一次性事件,触发一次就自动删除自己。
|
|
62
|
-
* @param eventName
|
|
63
|
-
* @param fn
|
|
64
|
-
*/
|
|
65
|
-
once(eventName: string, fn: Function, scope?: any): void;
|
|
66
59
|
/**
|
|
67
60
|
* @method dispatchEvent
|
|
68
61
|
*
|
|
@@ -76,6 +69,13 @@ declare abstract class ICEEventTarget {
|
|
|
76
69
|
* @returns
|
|
77
70
|
*/
|
|
78
71
|
trigger(eventName: string, originalEvent?: any, param?: {}): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* @method once
|
|
74
|
+
* 一次性事件,触发一次就自动删除自己。
|
|
75
|
+
* @param eventName
|
|
76
|
+
* @param fn
|
|
77
|
+
*/
|
|
78
|
+
once(eventName: string, fn: Function, scope?: any): void;
|
|
79
79
|
/**
|
|
80
80
|
* @method suspend
|
|
81
81
|
* 挂起事件。
|
|
@@ -233,11 +233,18 @@ declare abstract class ICEComponent extends ICEEventTarget {
|
|
|
233
233
|
*/
|
|
234
234
|
globalToLocal(globalX: number, globalY: number): number[];
|
|
235
235
|
/**
|
|
236
|
+
* @method getRotateAngle 获取组件的旋转角度。
|
|
236
237
|
* 根据变换矩阵计算组件在全局空间(canvas)中的旋转角度。
|
|
238
|
+
* @param refresh 如果为 true ,则重新计算变换矩阵,否则使用缓存的变换矩阵。
|
|
237
239
|
* @returns
|
|
238
240
|
*/
|
|
239
|
-
getRotateAngle(): number;
|
|
240
|
-
|
|
241
|
+
getRotateAngle(refresh?: boolean): number;
|
|
242
|
+
/**
|
|
243
|
+
* @method getLocalLeftTop 得到组件在局部坐标系中的左上角坐标。
|
|
244
|
+
* @param refresh 如果为 true ,则重新计算变换矩阵,否则使用缓存的变换矩阵。
|
|
245
|
+
* @returns
|
|
246
|
+
*/
|
|
247
|
+
getLocalLeftTop(refresh?: boolean): {
|
|
241
248
|
left: number;
|
|
242
249
|
top: number;
|
|
243
250
|
width: number;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import ICEComponent from '../ICEComponent';
|
|
2
2
|
import ICERect from '../shape/ICERect';
|
|
3
3
|
/**
|
|
4
|
-
* @class ICEGroup
|
|
4
|
+
* @class ICEGroup 容器型组件
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* ICEGroup 可以包含自身,利用此组件可以构造出树形的对象结构。
|
|
6
|
+
* - ICEGroup 可以带有子组件,所有容器型的组件都应该继承 ICEGroup
|
|
7
|
+
* - ICEGroup 可以包含自身,利用此组件可以构造出树形的组件结构。
|
|
9
8
|
*
|
|
10
9
|
* @author 大漠穷秋<damoqiongqiu@126.com>
|
|
11
10
|
*/
|
|
@@ -18,11 +18,12 @@ import ICECircle from '../shape/ICECircle';
|
|
|
18
18
|
declare class ICELinkSlot extends ICECircle {
|
|
19
19
|
private _hostComponent;
|
|
20
20
|
/**
|
|
21
|
-
* position
|
|
22
|
-
* - T:
|
|
23
|
-
* - R:
|
|
24
|
-
* - B:
|
|
25
|
-
* - L:
|
|
21
|
+
* position 的取值:
|
|
22
|
+
* - T: 宿主边界盒子的顶边中点
|
|
23
|
+
* - R: 宿主边界盒子的右边中点
|
|
24
|
+
* - B: 宿主边界盒子的底边中点
|
|
25
|
+
* - L: 宿主边界盒子的左边中点
|
|
26
|
+
* - C: 宿主边界盒子的几何中心点
|
|
26
27
|
*
|
|
27
28
|
* 连接插槽自身不可拖拽、不可连接。
|
|
28
29
|
* @param props
|
|
@@ -13,6 +13,7 @@ import ICE from '../../ICE';
|
|
|
13
13
|
export default class ICELinkSlotManager {
|
|
14
14
|
private slotRadius;
|
|
15
15
|
private ice;
|
|
16
|
+
private collision;
|
|
16
17
|
constructor(ice: ICE);
|
|
17
18
|
start(): this;
|
|
18
19
|
stop(): this;
|
|
@@ -20,8 +21,8 @@ export default class ICELinkSlotManager {
|
|
|
20
21
|
private hookMouseUpHandler;
|
|
21
22
|
protected globalMouseUpHandler(evt?: ICEEvent): void;
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* @method createLinkSlots
|
|
25
|
+
* 创建5个连接插槽,插槽默认分布在组件最小边界盒子的4条边中点和几何中心点。
|
|
25
26
|
*/
|
|
26
27
|
protected createLinkSlots(): void;
|
|
27
28
|
}
|
package/package.json
CHANGED