@leafer-in/editor 1.0.0-rc.6 → 1.0.0-rc.7

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/types/index.d.ts CHANGED
@@ -1,68 +1,218 @@
1
- import { IUI, IPolygon, IEventListenerId, IGroupInputData, IResizeType, IAround, IDragEvent, IBoundsData, IPointData } from '@leafer-ui/interface';
2
- import { IEditor, IEditorConfig, IEditorTool, IDirection8, IEditorResizeEvent, IEditorRotateEvent } from '@leafer-in/interface';
3
- import { Group, DragEvent, RotateEvent, Event } from '@leafer-ui/core';
1
+ import * as _leafer_ui_interface from '@leafer-ui/interface';
2
+ import { IBounds, ILeafList, IUI, IEventListenerId, ILeaf, IGroupInputData, IEditSize, IPointData, IBox, IGroup, IBoundsData, IRectInputData, IKeyEvent, IRect, ILeaferCanvas, IRenderOptions, IMatrixData, IDragEvent, IAround, AnswerType } from '@leafer-ui/interface';
3
+ import { Group, PointerEvent, DragEvent, MoveEvent, RotateEvent, Box, UI, Event } from '@leafer-ui/core';
4
+ import { IEditSelect, IEditor, IStroker, ISelectArea, IEditorConfig, IEditBox, IEditTool, IEditorScaleEvent, IEditPoint, IEditPointType, IDirection8, IEditorEvent, IEditorMoveEvent, IEditorRotateEvent, IEditorSkewEvent } from '@leafer-in/interface';
5
+
6
+ declare class EditSelect extends Group implements IEditSelect {
7
+ editor: IEditor;
8
+ get dragging(): boolean;
9
+ get running(): boolean;
10
+ get isMoveMode(): boolean;
11
+ hoverStroker: IStroker;
12
+ targetStroker: IStroker;
13
+ bounds: IBounds;
14
+ selectArea: ISelectArea;
15
+ protected originList: ILeafList;
16
+ protected lastDownLeaf: IUI;
17
+ protected __eventIds: IEventListenerId[];
18
+ constructor(editor: IEditor);
19
+ protected onHover(): void;
20
+ protected onSelect(): void;
21
+ update(): void;
22
+ protected onPointerMove(e: PointerEvent): void;
23
+ protected onBeforeDown(e: PointerEvent): void;
24
+ protected onTap(e: PointerEvent): void;
25
+ protected onDragStart(e: DragEvent): void;
26
+ protected onDrag(e: DragEvent): void;
27
+ protected onDragEnd(): void;
28
+ protected onAutoMove(e: MoveEvent): void;
29
+ protected allow(target: ILeaf): boolean;
30
+ protected allowDrag(e: DragEvent): boolean;
31
+ protected findDeepOne(e: PointerEvent): IUI;
32
+ protected __listenEvents(): void;
33
+ protected __removeListenEvents(): void;
34
+ destroy(): void;
35
+ }
4
36
 
5
37
  declare class Editor extends Group implements IEditor {
6
38
  config: IEditorConfig;
7
- resizePoints: IUI[];
8
- rotatePoints: IUI[];
9
- resizeLines: IUI[];
10
- targetRect: IUI;
11
- rect: IPolygon;
12
- circle: IUI;
13
- tool: IEditorTool;
14
- private _target;
15
- get target(): IUI;
16
- set target(value: IUI);
17
- enterPoint: IUI;
18
- protected __eventIds: IEventListenerId[];
19
- protected __targetEventIds: IEventListenerId[];
39
+ hoverTarget: IUI;
40
+ target: IUI | IUI[] | ILeafList;
41
+ leafList: ILeafList;
42
+ get list(): IUI[];
43
+ get hasTarget(): boolean;
44
+ get multiple(): boolean;
45
+ get single(): boolean;
46
+ get element(): IUI;
47
+ simulateTarget: IUI;
48
+ editBox: IEditBox;
49
+ get buttons(): _leafer_ui_interface.IGroup;
50
+ editTool: IEditTool;
51
+ selector: EditSelect;
52
+ get dragging(): boolean;
53
+ targetEventIds: IEventListenerId[];
20
54
  constructor(userConfig?: IEditorConfig, data?: IGroupInputData);
21
- protected init(): void;
22
- protected onTarget(): void;
23
- getTool(value: IUI): IEditorTool;
55
+ hasItem(item: IUI): boolean;
56
+ addItem(item: IUI): void;
57
+ removeItem(item: IUI): void;
58
+ shiftItem(item: IUI): void;
24
59
  update(): void;
60
+ updateEditTool(): void;
61
+ getEditSize(ui: IUI): IEditSize;
62
+ onMove(e: DragEvent): void;
63
+ onScale(e: DragEvent): void;
64
+ onRotate(e: DragEvent | RotateEvent): void;
65
+ onSkew(e: DragEvent): void;
66
+ move(x: number, y: number): void;
67
+ scaleWithDrag(data: IEditorScaleEvent): void;
68
+ scaleOf(origin: IPointData, scaleX: number, scaleY?: number, _resize?: boolean): void;
69
+ rotateOf(origin: IPointData, rotation: number): void;
70
+ skewOf(origin: IPointData, skewX: number, skewY?: number, _resize?: boolean): void;
71
+ group(): void;
72
+ ungroup(): void;
73
+ lock(): void;
74
+ unlock(): void;
75
+ toTop(): void;
76
+ toBottom(): void;
77
+ listenTargetEvents(): void;
78
+ removeTargetEvents(): void;
79
+ destroy(): void;
80
+ }
81
+
82
+ declare class EditBox extends Group implements IEditBox {
83
+ editor: IEditor;
84
+ dragging: boolean;
85
+ rect: IBox;
86
+ circle: IEditPoint;
87
+ buttons: IGroup;
88
+ resizePoints: IEditPoint[];
89
+ rotatePoints: IEditPoint[];
90
+ resizeLines: IEditPoint[];
91
+ get flipped(): boolean;
92
+ get flippedX(): boolean;
93
+ get flippedY(): boolean;
94
+ get flippedOne(): boolean;
95
+ enterPoint: IEditPoint;
96
+ protected __eventIds: IEventListenerId[];
97
+ constructor(editor: IEditor);
98
+ create(): void;
99
+ update(bounds: IBoundsData): void;
100
+ protected layoutButtons(): void;
101
+ getPointStyle(userStyle?: IRectInputData): IRectInputData;
102
+ getPointsStyle(): IRectInputData[];
103
+ getMiddlePointsStyle(): IRectInputData[];
104
+ getDirection8Points(bounds: IBoundsData): IPointData[];
105
+ protected onDragStart(e: DragEvent): void;
106
+ protected onDragEnd(e: DragEvent): void;
25
107
  protected onDrag(e: DragEvent): void;
26
- protected onMove(e: DragEvent): void;
27
- protected onRotate(e: DragEvent | RotateEvent): void;
28
- onResize(e: DragEvent): void;
29
- updateMoveCursor(): void;
108
+ onArrow(e: IKeyEvent): void;
109
+ protected onDoubleClick(): void;
110
+ listenPointEvents(point: IEditPoint, type: IEditPointType, direction: IDirection8): void;
30
111
  protected __listenEvents(): void;
31
112
  protected __removeListenEvents(): void;
32
- protected __listenPointEvents(point: IUI, type: 'rotate' | 'resize', direction: IDirection8): void;
33
- protected __listenTargetEvents(): void;
34
- protected __removeTargetEvents(): void;
35
113
  destroy(): void;
36
114
  }
37
115
 
38
- declare class EditorResizeEvent extends Event implements IEditorResizeEvent {
39
- static RESIZE: string;
116
+ declare class EditPoint extends Box implements IEditPoint {
117
+ direction: IDirection8;
118
+ pointType: IEditPointType;
119
+ }
120
+
121
+ declare class SelectArea extends Group implements ISelectArea {
122
+ protected strokeArea: IRect;
123
+ protected fillArea: IRect;
124
+ constructor(data?: IGroupInputData);
125
+ setStyle(style: IRectInputData, userStyle?: IRectInputData): void;
126
+ setBounds(bounds: IBoundsData): void;
127
+ }
128
+
129
+ declare class Stroker extends UI implements IStroker {
130
+ target: IUI | IUI[];
131
+ list: IUI[];
132
+ constructor();
133
+ setTarget(target: IUI | IUI[], style: IRectInputData): void;
134
+ __draw(canvas: ILeaferCanvas, options: IRenderOptions): void;
135
+ destroy(): void;
136
+ }
137
+
138
+ declare class EditorEvent extends Event implements IEditorEvent {
139
+ static SELECT: string;
140
+ static HOVER: string;
40
141
  readonly target: IUI;
41
142
  readonly editor: IEditor;
42
- readonly resizeType: IResizeType;
43
- readonly lockRatio: boolean;
44
- readonly around: IAround;
45
- readonly dragEvent: IDragEvent;
46
- readonly direction: IDirection8;
47
- readonly bounds: IBoundsData;
48
- readonly old: IBoundsData;
143
+ readonly worldOrigin: IPointData;
49
144
  readonly origin: IPointData;
145
+ constructor(type: string, data?: IEditorEvent);
146
+ }
147
+
148
+ declare class EditorMoveEvent extends EditorEvent implements IEditorMoveEvent {
149
+ static MOVE: string;
150
+ readonly moveX: number;
151
+ readonly moveY: number;
152
+ constructor(type: string, data?: IEditorMoveEvent);
153
+ }
154
+
155
+ declare class EditorScaleEvent extends EditorEvent implements IEditorScaleEvent {
156
+ static SCALE: string;
50
157
  readonly scaleX: number;
51
158
  readonly scaleY: number;
52
- constructor(type: string, data?: IEditorResizeEvent);
159
+ readonly transform?: IMatrixData;
160
+ readonly drag: IDragEvent;
161
+ readonly direction: IDirection8;
162
+ readonly lockRatio: boolean;
163
+ readonly around: IAround;
164
+ constructor(type: string, data?: IEditorScaleEvent);
53
165
  }
54
166
 
55
- declare class EditorRotateEvent extends Event implements IEditorRotateEvent {
167
+ declare class EditorRotateEvent extends EditorEvent implements IEditorRotateEvent {
56
168
  static ROTATE: string;
57
- readonly target: IUI;
58
- readonly editor: IEditor;
59
- readonly origin: IPointData;
60
169
  readonly rotation: number;
61
170
  constructor(type: string, data?: IEditorRotateEvent);
62
171
  }
63
172
 
64
- declare const LineTool: IEditorTool;
173
+ declare class EditorSkewEvent extends EditorEvent implements IEditorSkewEvent {
174
+ static SKEW: string;
175
+ readonly skewX: number;
176
+ readonly skewY: number;
177
+ constructor(type: string, data?: IEditorSkewEvent);
178
+ }
179
+
180
+ declare class EditTool implements IEditTool {
181
+ static list: IEditTool[];
182
+ tag: string;
183
+ onMove(e: IEditorMoveEvent): void;
184
+ onScale(e: IEditorScaleEvent): void;
185
+ onRotate(e: IEditorRotateEvent): void;
186
+ onSkew(e: IEditorSkewEvent): void;
187
+ update(editor: IEditor): void;
188
+ }
189
+
190
+ declare class LineEditTool extends EditTool {
191
+ tag: string;
192
+ scaleOfEvent: boolean;
193
+ onScaleWithDrag(e: IEditorScaleEvent): void;
194
+ onSkew(_e: IEditorSkewEvent): void;
195
+ update(editor: IEditor): void;
196
+ }
197
+
198
+ declare const EditorHelper: {
199
+ group(list: IUI[], element?: IUI, group?: IGroup): IGroup;
200
+ ungroup(list: IUI[]): IUI[];
201
+ toTop(list: IUI[]): void;
202
+ toBottom(list: IUI[]): void;
203
+ };
204
+
205
+ declare const EditDataHelper: {
206
+ getScaleData(bounds: IBoundsData, direction: IDirection8, pointMove: IPointData, lockRatio: boolean, around: IAround): IEditorScaleEvent;
207
+ getRotateData(bounds: IBoundsData, direction: IDirection8, current: IPointData, last: IPointData, around: IAround): IEditorRotateEvent;
208
+ getSkewData(bounds: IBoundsData, direction: IDirection8, move: IPointData, around: IAround): IEditorSkewEvent;
209
+ getAround(around: IAround, altKey: boolean): IAround;
210
+ getRotateDirection(direction: number, rotation: number, totalDirection?: number): number;
211
+ };
65
212
 
66
- declare const RectTool: IEditorTool;
213
+ declare const EditSelectHelper: {
214
+ findOne(path: ILeafList): IUI;
215
+ findBounds(leaf: IUI, bounds: IBounds): AnswerType;
216
+ };
67
217
 
68
- export { Editor, EditorResizeEvent, EditorRotateEvent, LineTool, RectTool };
218
+ export { EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, Editor, EditorEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, LineEditTool, SelectArea, Stroker };
package/src/cursor.ts DELETED
@@ -1,57 +0,0 @@
1
- import { ICursorType, IUIEvent } from '@leafer-ui/interface'
2
- import { IDirection8, IEditor } from '@leafer-in/interface'
3
-
4
-
5
- const { topLeft, top, topRight, right, bottomRight, bottom, bottomLeft, left } = IDirection8
6
-
7
- export function updateCursor(editor: IEditor, e: IUIEvent): void {
8
-
9
- const point = editor.enterPoint
10
- if (!point || !editor.target || !editor.visible) return
11
-
12
- let { rotation } = editor
13
- let { resizeCursor, rotateCursor, resizeable } = editor.config
14
- const mirror = editor.tool.getMirrorData(editor)
15
- const { __direction, __isResizePoint } = point.__
16
-
17
- editor.enterPoint = point
18
-
19
- if (__isResizePoint && (e.metaKey || e.ctrlKey || !resizeable)) resizeCursor = rotateCursor
20
-
21
- if (mirror.x || mirror.y) {
22
- mirrorCursors(resizeCursor = [...resizeCursor], mirror.x, mirror.y)
23
- mirrorCursors(rotateCursor = [...rotateCursor], mirror.y, mirror.x)
24
- if (mirror.x + mirror.y === 1) rotation = -rotation
25
- }
26
-
27
- let index = (__direction + Math.round(rotation / 45)) % 8
28
- if (index < 0) index += 8
29
-
30
- point.cursor = __isResizePoint ? resizeCursor[index] : rotateCursor[index]
31
-
32
- }
33
-
34
-
35
- export function mirrorCursors(mirror: ICursorType[], mirrorX: number, mirrorY: number): void {
36
-
37
- if (mirrorX) {
38
- const topCursor = mirror[top], topLeftCursor = mirror[topLeft], topRightCursor = mirror[topRight]
39
- mirror[top] = mirror[bottom]
40
- mirror[topLeft] = mirror[bottomLeft]
41
- mirror[topRight] = mirror[bottomRight]
42
- mirror[bottom] = topCursor
43
- mirror[bottomLeft] = topLeftCursor
44
- mirror[bottomRight] = topRightCursor
45
- }
46
-
47
- if (mirrorY) {
48
- const leftCursor = mirror[left], topLeftCursor = mirror[topLeft], bottomLeftCursor = mirror[bottomLeft]
49
- mirror[left] = mirror[right]
50
- mirror[topLeft] = mirror[topRight]
51
- mirror[bottomLeft] = mirror[bottomRight]
52
- mirror[right] = leftCursor
53
- mirror[topRight] = topLeftCursor
54
- mirror[bottomRight] = bottomLeftCursor
55
- }
56
-
57
- }
@@ -1,34 +0,0 @@
1
- import { IUI, IResizeType, IBoundsData, IPointData, IAround, IDragEvent } from '@leafer-ui/interface'
2
- import { IEditor, IDirection8, IEditorResizeEvent } from '@leafer-in/interface'
3
-
4
- import { Event } from '@leafer-ui/core'
5
-
6
- export class EditorResizeEvent extends Event implements IEditorResizeEvent {
7
-
8
- static RESIZE = 'editor.resize'
9
-
10
- declare readonly target: IUI
11
- readonly editor: IEditor
12
-
13
- readonly resizeType: IResizeType
14
- readonly lockRatio: boolean
15
- readonly around: IAround
16
-
17
- readonly dragEvent: IDragEvent
18
- readonly direction: IDirection8
19
-
20
- // from old to bounds
21
- readonly bounds: IBoundsData
22
- readonly old: IBoundsData
23
-
24
- // scaleOf(origin, scaleX, scaleY)
25
- declare readonly origin: IPointData
26
- readonly scaleX: number
27
- readonly scaleY: number
28
-
29
- constructor(type: string, data?: IEditorResizeEvent) {
30
- super(type)
31
- if (data) Object.assign(this, data)
32
- }
33
-
34
- }
package/src/resize.ts DELETED
@@ -1,87 +0,0 @@
1
- import { IBoundsData, IPointData, IMatrixData, IAround } from '@leafer-ui/interface'
2
- import { IEditorResizeEvent, IDirection8 } from '@leafer-in/interface'
3
-
4
- import { MatrixHelper } from '@leafer-ui/core'
5
-
6
-
7
- const { scaleOfOuter, reset } = MatrixHelper
8
- const { topLeft, top, topRight, right, bottomRight, bottom, bottomLeft, left } = IDirection8
9
- const matrix = {} as IMatrixData
10
-
11
- export function getResizeData(old: IBoundsData, direction: IDirection8, move: IPointData, lockRatio: boolean, around: IAround): IEditorResizeEvent {
12
-
13
- if (around) {
14
- move.x *= 2
15
- move.y *= 2
16
- }
17
-
18
- let origin: IPointData, scaleX: number = 1, scaleY: number = 1
19
- const { x, y, width, height } = old
20
-
21
- const topScale = (-move.y + height) / height
22
- const rightScale = (move.x + width) / width
23
- const bottomScale = (move.y + height) / height
24
- const leftScale = (-move.x + width) / width
25
-
26
- switch (direction) {
27
- case top:
28
- scaleY = topScale
29
- if (lockRatio) scaleX = scaleY
30
- origin = { x: x + width / 2, y: y + height }
31
- break
32
- case right:
33
- scaleX = rightScale
34
- if (lockRatio) scaleY = scaleX
35
- origin = { x, y: y + height / 2 }
36
- break
37
- case bottom:
38
- scaleY = bottomScale
39
- if (lockRatio) scaleX = scaleY
40
- origin = { x: x + width / 2, y }
41
- break
42
- case left:
43
- scaleX = leftScale
44
- if (lockRatio) scaleY = scaleX
45
- origin = { x: x + width, y: y + height / 2 }
46
- break
47
- case topLeft:
48
- scaleY = topScale
49
- scaleX = leftScale
50
- if (lockRatio) scaleX = scaleY
51
- origin = { x: x + width, y: y + height }
52
- break
53
- case topRight:
54
- scaleY = topScale
55
- scaleX = rightScale
56
- if (lockRatio) scaleX = scaleY
57
- origin = { x, y: y + height }
58
- break
59
- case bottomRight:
60
- scaleY = bottomScale
61
- scaleX = rightScale
62
- if (lockRatio) scaleX = scaleY
63
- origin = { x, y }
64
- break
65
- case bottomLeft:
66
- scaleY = bottomScale
67
- scaleX = leftScale
68
- if (lockRatio) scaleX = scaleY
69
- origin = { x: x + width, y }
70
- break
71
- }
72
-
73
- if (around) {
74
- if (typeof around === 'object') {
75
- origin = { x: x + width / around.x, y: y + height / around.y }
76
- } else {
77
- origin = { x: x + width / 2, y: y + height / 2 }
78
- }
79
- }
80
-
81
- reset(matrix)
82
- scaleOfOuter(matrix, origin, scaleX, scaleY)
83
- const bounds = { x: old.x + matrix.e, y: old.y + matrix.f, width: width * scaleX, height: height * scaleY }
84
- return { bounds, old, origin, scaleX, scaleY, direction, lockRatio, around, }
85
-
86
- }
87
-
@@ -1,141 +0,0 @@
1
- import { IUI, IUIInputData, IPointData } from '@leafer-ui/interface'
2
- import { IEditor, IEditorResizeEvent, IEditorRotateEvent, IEditorTool } from '@leafer-in/interface'
3
-
4
- import { Bounds, Matrix } from '@leafer-ui/core'
5
-
6
-
7
- export const RectTool: IEditorTool = {
8
-
9
- name: 'RectTool',
10
-
11
- getMirrorData(editor: IEditor): IPointData {
12
- const { scaleX, scaleY } = editor.target
13
- return {
14
- x: scaleX < 0 ? 1 : 0, // 1 = mirrorX
15
- y: scaleY < 0 ? 1 : 0
16
- }
17
- },
18
-
19
- resize(e: IEditorResizeEvent): void {
20
- const { target, bounds, resizeType, old } = e
21
- const { x, y, width, height } = bounds
22
- const point = { x: x - old.x, y: y - old.y }
23
-
24
- target.innerToWorld(point, null, true, target.parent)
25
- target.x += point.x
26
- target.y += point.y
27
-
28
- if (resizeType === 'scale') {
29
- target.scaleX *= width / old.width
30
- target.scaleY *= height / old.height
31
- } else {
32
- if (width < 0) {
33
- target.width = -width
34
- target.scaleX *= -1
35
- } else {
36
- if (target.width !== width) target.width = width
37
- }
38
-
39
- if (height < 0) {
40
- target.height = -height
41
- target.scaleY *= -1
42
- } else {
43
- if (target.height !== height) target.height = height // Text auto height
44
- }
45
-
46
-
47
- }
48
- },
49
-
50
- rotate(e: IEditorRotateEvent): void {
51
- const { target, rotation, origin } = e
52
- target.rotateOf(origin, rotation)
53
- },
54
-
55
- update(editor: IEditor) {
56
- const { target, config, rotatePoints, targetRect, rect, circle, resizeLines, resizePoints } = editor
57
- const { type, resizeable, rotateable, stroke, pointFill, pointSize, pointRadius } = config
58
-
59
- const defaultStyle = { fill: pointFill, stroke, width: pointSize, height: pointSize, cornerRadius: pointRadius }
60
- const pointStyles = config.point instanceof Array ? config.point : [config.point || defaultStyle]
61
-
62
- const box = new Bounds(target.boxBounds)
63
- const w = target.worldTransform, pw = editor.parent.worldTransform
64
-
65
- const matrix = new Matrix(w)
66
- matrix.divide(pw)
67
- const worldX = matrix.e, worldY = matrix.f
68
-
69
-
70
- let { scaleX, scaleY, rotation, skewX, skewY } = w
71
- scaleX /= pw.scaleX, scaleY /= pw.scaleY, rotation -= pw.rotation, skewX -= pw.skewX, skewY -= pw.skewY
72
-
73
- const { x, y, width, height } = box.scale(scaleX, scaleY) // maybe width / height < 0
74
-
75
- editor.set({ x: worldX, y: worldY, rotation, skewX, skewY })
76
- targetRect.set({ x, y, width: box.width / scaleX, height: box.height / scaleY, scaleX, scaleY, visible: true })
77
-
78
-
79
- const points: IPointData[] = [ // topLeft, top, topRight, right, bottomRight, bottom, bottomLeft, left
80
- { x, y },
81
- { x: x + width / 2, y },
82
- { x: x + width, y },
83
- { x: x + width, y: y + height / 2 },
84
- { x: x + width, y: y + height },
85
- { x: x + width / 2, y: y + height },
86
- { x, y: y + height },
87
- { x, y: y + height / 2 }
88
- ]
89
-
90
- const rectPoints: number[] = []
91
- let point: IPointData, style: IUIInputData, rotateP: IUI, resizeP: IUI, resizeL: IUI
92
-
93
- for (let i = 0; i < 8; i++) {
94
- point = points[i]
95
- style = pointStyles[i % pointStyles.length]
96
-
97
- resizeP = resizePoints[i]
98
- resizeL = resizeLines[Math.floor(i / 2)]
99
- rotateP = rotatePoints[i]
100
-
101
- resizeP.set(style)
102
- resizeP.x = rotateP.x = resizeL.x = point.x
103
- resizeP.y = rotateP.y = resizeL.y = point.y
104
-
105
- resizeP.visible = resizeL.visible = resizeable || rotateable
106
- rotateP.visible = rotateable && resizeable
107
-
108
- if (i % 2) { // top, right, bottom, left
109
- if (((i + 1) / 2) % 2) { // top, bottom
110
- resizeL.width = Math.abs(width)
111
- rotateP.width = Math.max(10, Math.abs(width) - 30) // skew
112
- } else {
113
- resizeL.height = Math.abs(height)
114
- rotateP.height = Math.max(10, Math.abs(height) - 30) // skew
115
- }
116
-
117
- resizeP.rotation = 90
118
- resizeP.visible = type === 'mobile'
119
- rotateP.visible = false
120
-
121
- } else {
122
- rotateP.visible = type !== 'mobile'
123
- rectPoints.push(point.x, point.y)
124
- }
125
- }
126
-
127
-
128
-
129
- style = config.rotatePoint || style
130
-
131
- circle.set(style)
132
- circle.x = x + width / 2
133
- if (!style.y) circle.y = y - (10 + (resizeP.height + circle.height) / 2) * (this.getMirrorData(editor).y ? -1 : 1)
134
- circle.visible = rotateable && type === 'mobile'
135
-
136
- rect.set(config.rect || { stroke })
137
- rect.points = rectPoints
138
- rect.visible = true
139
- }
140
-
141
- }