@idraw/core 0.4.0-beta.30 → 0.4.0-beta.31
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/dist/esm/index.d.ts +2 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/middleware/info/config.d.ts +4 -0
- package/dist/esm/middleware/info/config.js +8 -0
- package/dist/esm/middleware/info/draw-info.d.ts +4 -6
- package/dist/esm/middleware/info/draw-info.js +12 -9
- package/dist/esm/middleware/info/index.d.ts +2 -2
- package/dist/esm/middleware/info/index.js +11 -9
- package/dist/esm/middleware/ruler/config.d.ts +7 -0
- package/dist/esm/middleware/ruler/config.js +21 -0
- package/dist/esm/middleware/ruler/index.d.ts +2 -2
- package/dist/esm/middleware/ruler/index.js +19 -6
- package/dist/esm/middleware/ruler/util.d.ts +6 -1
- package/dist/esm/middleware/ruler/util.js +13 -19
- package/dist/esm/middleware/scroller/config.d.ts +2 -0
- package/dist/esm/middleware/scroller/config.js +8 -0
- package/dist/esm/middleware/scroller/index.d.ts +2 -2
- package/dist/esm/middleware/scroller/index.js +13 -3
- package/dist/esm/middleware/scroller/util.d.ts +2 -1
- package/dist/esm/middleware/scroller/util.js +19 -36
- package/dist/esm/middleware/selector/config.d.ts +2 -4
- package/dist/esm/middleware/selector/config.js +10 -4
- package/dist/esm/middleware/selector/draw-auxiliary.d.ts +1 -7
- package/dist/esm/middleware/selector/draw-auxiliary.js +1 -35
- package/dist/esm/middleware/selector/draw-reference.d.ts +2 -0
- package/dist/esm/middleware/selector/draw-reference.js +2 -2
- package/dist/esm/middleware/selector/draw-wrapper.d.ts +7 -1
- package/dist/esm/middleware/selector/draw-wrapper.js +22 -13
- package/dist/esm/middleware/selector/index.d.ts +2 -2
- package/dist/esm/middleware/selector/index.js +16 -11
- package/dist/index.global.js +193 -104
- package/dist/index.global.min.js +1 -1
- package/package.json +5 -5
|
@@ -23,11 +23,17 @@ export const keyDebugEnd0 = Symbol(`${key}_debug_end0`);
|
|
|
23
23
|
export const selectWrapperBorderWidth = 2;
|
|
24
24
|
export const resizeControllerBorderWidth = 4;
|
|
25
25
|
export const areaBorderWidth = 1;
|
|
26
|
-
export const wrapperColor = '#1973ba';
|
|
27
|
-
export const lockColor = '#5b5959b5';
|
|
28
26
|
export const controllerSize = 10;
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
const activeColor = '#1973ba';
|
|
28
|
+
const activeAreaColor = '#1976d21c';
|
|
29
|
+
const lockedColor = '#5b5959b5';
|
|
30
|
+
const referenceColor = '#f7276e';
|
|
31
|
+
export const defaultStyle = {
|
|
32
|
+
activeColor,
|
|
33
|
+
activeAreaColor,
|
|
34
|
+
lockedColor,
|
|
35
|
+
referenceColor
|
|
36
|
+
};
|
|
31
37
|
export const middlewareEventSelect = '@middleware/select';
|
|
32
38
|
export const middlewareEventSelectClear = '@middleware/select-clear';
|
|
33
39
|
export const middlewareEventSelectInGroup = '@middleware/select-in-group';
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function drawAuxiliaryExperimentBox(ctx: ViewContext2D, opts: {
|
|
3
|
-
calculator: ViewCalculator;
|
|
4
|
-
element: Element | null;
|
|
5
|
-
viewScaleInfo: ViewScaleInfo;
|
|
6
|
-
viewSizeInfo: ViewSizeInfo;
|
|
7
|
-
}): void;
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { auxiliaryColor } from './config';
|
|
2
|
-
import { drawLine, drawCrossByCenter } from './draw-base';
|
|
3
1
|
function getViewBoxInfo(rectInfo) {
|
|
4
2
|
const boxInfo = {
|
|
5
3
|
minX: rectInfo.topLeft.x,
|
|
@@ -11,36 +9,4 @@ function getViewBoxInfo(rectInfo) {
|
|
|
11
9
|
};
|
|
12
10
|
return boxInfo;
|
|
13
11
|
}
|
|
14
|
-
export
|
|
15
|
-
const { element, viewScaleInfo, viewSizeInfo, calculator } = opts;
|
|
16
|
-
if (!element) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const viewRectInfo = calculator.calcViewRectInfoFromRange(element.uuid, { viewScaleInfo, viewSizeInfo });
|
|
20
|
-
if (!viewRectInfo) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
const lineOpts = {
|
|
24
|
-
borderColor: auxiliaryColor,
|
|
25
|
-
borderWidth: 1,
|
|
26
|
-
lineDash: []
|
|
27
|
-
};
|
|
28
|
-
const boxInfo = getViewBoxInfo(viewRectInfo);
|
|
29
|
-
const { width, height } = viewSizeInfo;
|
|
30
|
-
drawLine(ctx, { x: boxInfo.minX, y: 0 }, { x: boxInfo.minX, y: height }, lineOpts);
|
|
31
|
-
drawLine(ctx, { x: boxInfo.midX, y: 0 }, { x: boxInfo.midX, y: height }, lineOpts);
|
|
32
|
-
drawLine(ctx, { x: boxInfo.maxX, y: 0 }, { x: boxInfo.maxX, y: height }, lineOpts);
|
|
33
|
-
drawLine(ctx, { x: 0, y: boxInfo.minY }, { x: width, y: boxInfo.minY }, lineOpts);
|
|
34
|
-
drawLine(ctx, { x: 0, y: boxInfo.midY }, { x: width, y: boxInfo.midY }, lineOpts);
|
|
35
|
-
drawLine(ctx, { x: 0, y: boxInfo.maxY }, { x: width, y: boxInfo.maxY }, lineOpts);
|
|
36
|
-
const crossOpts = Object.assign(Object.assign({}, lineOpts), { size: 6 });
|
|
37
|
-
drawCrossByCenter(ctx, viewRectInfo.center, crossOpts);
|
|
38
|
-
drawCrossByCenter(ctx, viewRectInfo.topLeft, crossOpts);
|
|
39
|
-
drawCrossByCenter(ctx, viewRectInfo.topRight, crossOpts);
|
|
40
|
-
drawCrossByCenter(ctx, viewRectInfo.bottomLeft, crossOpts);
|
|
41
|
-
drawCrossByCenter(ctx, viewRectInfo.bottomRight, crossOpts);
|
|
42
|
-
drawCrossByCenter(ctx, viewRectInfo.top, crossOpts);
|
|
43
|
-
drawCrossByCenter(ctx, viewRectInfo.right, crossOpts);
|
|
44
|
-
drawCrossByCenter(ctx, viewRectInfo.bottom, crossOpts);
|
|
45
|
-
drawCrossByCenter(ctx, viewRectInfo.left, crossOpts);
|
|
46
|
-
}
|
|
12
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ViewContext2D, PointSize } from '@idraw/types';
|
|
2
|
+
import { MiddlewareSelectorStyle } from './types';
|
|
2
3
|
export declare function drawReferenceLines(ctx: ViewContext2D, opts: {
|
|
3
4
|
xLines?: Array<PointSize[]>;
|
|
4
5
|
yLines?: Array<PointSize[]>;
|
|
6
|
+
style: MiddlewareSelectorStyle;
|
|
5
7
|
}): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { referenceColor } from './config';
|
|
2
1
|
import { drawLine, drawCrossByCenter } from './draw-base';
|
|
3
2
|
export function drawReferenceLines(ctx, opts) {
|
|
4
|
-
const { xLines, yLines } = opts;
|
|
3
|
+
const { xLines, yLines, style } = opts;
|
|
4
|
+
const { referenceColor } = style;
|
|
5
5
|
const lineOpts = {
|
|
6
6
|
borderColor: referenceColor,
|
|
7
7
|
borderWidth: 1,
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { Element, ElementType, PointSize, RendererDrawElementOptions, ViewContext2D, ViewRectVertexes, ViewScaleInfo, ViewSizeInfo, ElementSizeController, ViewCalculator } from '@idraw/types';
|
|
2
|
-
import type { AreaSize } from './types';
|
|
2
|
+
import type { AreaSize, MiddlewareSelectorStyle } from './types';
|
|
3
3
|
export declare function drawHoverVertexesWrapper(ctx: ViewContext2D, vertexes: ViewRectVertexes | null, opts: {
|
|
4
4
|
viewScaleInfo: ViewScaleInfo;
|
|
5
5
|
viewSizeInfo: ViewSizeInfo;
|
|
6
|
+
style: MiddlewareSelectorStyle;
|
|
6
7
|
}): void;
|
|
7
8
|
export declare function drawLockVertexesWrapper(ctx: ViewContext2D, vertexes: ViewRectVertexes | null, opts: {
|
|
8
9
|
viewScaleInfo: ViewScaleInfo;
|
|
9
10
|
viewSizeInfo: ViewSizeInfo;
|
|
10
11
|
controller?: ElementSizeController | null;
|
|
12
|
+
style: MiddlewareSelectorStyle;
|
|
11
13
|
}): void;
|
|
12
14
|
export declare function drawSelectedElementControllersVertexes(ctx: ViewContext2D, controller: ElementSizeController | null, opts: {
|
|
13
15
|
hideControllers: boolean;
|
|
@@ -15,16 +17,20 @@ export declare function drawSelectedElementControllersVertexes(ctx: ViewContext2
|
|
|
15
17
|
viewSizeInfo: ViewSizeInfo;
|
|
16
18
|
element: Element | null;
|
|
17
19
|
calculator: ViewCalculator;
|
|
20
|
+
style: MiddlewareSelectorStyle;
|
|
18
21
|
}): void;
|
|
19
22
|
export declare function drawElementListShadows(ctx: ViewContext2D, elements: Element<ElementType>[], opts?: Omit<RendererDrawElementOptions, 'loader'>): void;
|
|
20
23
|
export declare function drawArea(ctx: ViewContext2D, opts: {
|
|
21
24
|
start: PointSize;
|
|
22
25
|
end: PointSize;
|
|
26
|
+
style: MiddlewareSelectorStyle;
|
|
23
27
|
}): void;
|
|
24
28
|
export declare function drawListArea(ctx: ViewContext2D, opts: {
|
|
25
29
|
areaSize: AreaSize;
|
|
30
|
+
style: MiddlewareSelectorStyle;
|
|
26
31
|
}): void;
|
|
27
32
|
export declare function drawGroupQueueVertexesWrappers(ctx: ViewContext2D, vertexesList: ViewRectVertexes[], opts: {
|
|
28
33
|
viewScaleInfo: ViewScaleInfo;
|
|
29
34
|
viewSizeInfo: ViewSizeInfo;
|
|
35
|
+
style: MiddlewareSelectorStyle;
|
|
30
36
|
}): void;
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import { rotateElementVertexes, calcViewPointSize, calcViewVertexes, calcViewElementSize } from '@idraw/util';
|
|
2
|
-
import { resizeControllerBorderWidth, areaBorderWidth,
|
|
2
|
+
import { resizeControllerBorderWidth, areaBorderWidth, selectWrapperBorderWidth, controllerSize } from './config';
|
|
3
3
|
import { drawVertexes, drawLine, drawCircleController, drawCrossVertexes } from './draw-base';
|
|
4
4
|
export function drawHoverVertexesWrapper(ctx, vertexes, opts) {
|
|
5
5
|
if (!vertexes) {
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
8
|
+
const { style } = opts;
|
|
9
|
+
const { activeColor } = style;
|
|
10
|
+
const wrapperOpts = { borderColor: activeColor, borderWidth: 1, background: 'transparent', lineDash: [] };
|
|
9
11
|
drawVertexes(ctx, calcViewVertexes(vertexes, opts), wrapperOpts);
|
|
10
12
|
}
|
|
11
13
|
export function drawLockVertexesWrapper(ctx, vertexes, opts) {
|
|
12
14
|
if (!vertexes) {
|
|
13
15
|
return;
|
|
14
16
|
}
|
|
15
|
-
const
|
|
17
|
+
const { style } = opts;
|
|
18
|
+
const { lockedColor } = style;
|
|
19
|
+
const wrapperOpts = { borderColor: lockedColor, borderWidth: 1, background: 'transparent', lineDash: [] };
|
|
16
20
|
drawVertexes(ctx, calcViewVertexes(vertexes, opts), wrapperOpts);
|
|
17
21
|
const { controller } = opts;
|
|
18
22
|
if (controller) {
|
|
19
23
|
const { topLeft, topRight, bottomLeft, bottomRight, topMiddle, bottomMiddle, leftMiddle, rightMiddle } = controller;
|
|
20
|
-
const ctrlOpts = Object.assign(Object.assign({}, wrapperOpts), { borderWidth: 1, background:
|
|
24
|
+
const ctrlOpts = Object.assign(Object.assign({}, wrapperOpts), { borderWidth: 1, background: lockedColor });
|
|
21
25
|
drawCrossVertexes(ctx, calcViewVertexes(topMiddle.vertexes, opts), ctrlOpts);
|
|
22
26
|
drawCrossVertexes(ctx, calcViewVertexes(bottomMiddle.vertexes, opts), ctrlOpts);
|
|
23
27
|
drawCrossVertexes(ctx, calcViewVertexes(leftMiddle.vertexes, opts), ctrlOpts);
|
|
@@ -32,9 +36,10 @@ export function drawSelectedElementControllersVertexes(ctx, controller, opts) {
|
|
|
32
36
|
if (!controller) {
|
|
33
37
|
return;
|
|
34
38
|
}
|
|
35
|
-
const { hideControllers } = opts;
|
|
39
|
+
const { hideControllers, style } = opts;
|
|
40
|
+
const { activeColor } = style;
|
|
36
41
|
const { elementWrapper, topLeft, topRight, bottomLeft, bottomRight, top, rotate } = controller;
|
|
37
|
-
const wrapperOpts = { borderColor:
|
|
42
|
+
const wrapperOpts = { borderColor: activeColor, borderWidth: selectWrapperBorderWidth, background: 'transparent', lineDash: [] };
|
|
38
43
|
const ctrlOpts = Object.assign(Object.assign({}, wrapperOpts), { borderWidth: resizeControllerBorderWidth, background: '#FFFFFF' });
|
|
39
44
|
drawVertexes(ctx, calcViewVertexes(elementWrapper, opts), wrapperOpts);
|
|
40
45
|
if (!hideControllers) {
|
|
@@ -76,11 +81,12 @@ export function drawElementListShadows(ctx, elements, opts) {
|
|
|
76
81
|
});
|
|
77
82
|
}
|
|
78
83
|
export function drawArea(ctx, opts) {
|
|
79
|
-
const { start, end } = opts;
|
|
84
|
+
const { start, end, style } = opts;
|
|
85
|
+
const { activeColor, activeAreaColor } = style;
|
|
80
86
|
ctx.setLineDash([]);
|
|
81
87
|
ctx.lineWidth = areaBorderWidth;
|
|
82
|
-
ctx.strokeStyle =
|
|
83
|
-
ctx.fillStyle =
|
|
88
|
+
ctx.strokeStyle = activeColor;
|
|
89
|
+
ctx.fillStyle = activeAreaColor;
|
|
84
90
|
ctx.beginPath();
|
|
85
91
|
ctx.moveTo(start.x, start.y);
|
|
86
92
|
ctx.lineTo(end.x, start.y);
|
|
@@ -91,12 +97,13 @@ export function drawArea(ctx, opts) {
|
|
|
91
97
|
ctx.fill();
|
|
92
98
|
}
|
|
93
99
|
export function drawListArea(ctx, opts) {
|
|
94
|
-
const { areaSize } = opts;
|
|
100
|
+
const { areaSize, style } = opts;
|
|
101
|
+
const { activeColor, activeAreaColor } = style;
|
|
95
102
|
const { x, y, w, h } = areaSize;
|
|
96
103
|
ctx.setLineDash([]);
|
|
97
104
|
ctx.lineWidth = areaBorderWidth;
|
|
98
|
-
ctx.strokeStyle =
|
|
99
|
-
ctx.fillStyle =
|
|
105
|
+
ctx.strokeStyle = activeColor;
|
|
106
|
+
ctx.fillStyle = activeAreaColor;
|
|
100
107
|
ctx.beginPath();
|
|
101
108
|
ctx.moveTo(x, y);
|
|
102
109
|
ctx.lineTo(x + w, y);
|
|
@@ -107,9 +114,11 @@ export function drawListArea(ctx, opts) {
|
|
|
107
114
|
ctx.fill();
|
|
108
115
|
}
|
|
109
116
|
export function drawGroupQueueVertexesWrappers(ctx, vertexesList, opts) {
|
|
117
|
+
const { style } = opts;
|
|
118
|
+
const { activeColor } = style;
|
|
110
119
|
for (let i = 0; i < vertexesList.length; i++) {
|
|
111
120
|
const vertexes = vertexesList[i];
|
|
112
|
-
const wrapperOpts = { borderColor:
|
|
121
|
+
const wrapperOpts = { borderColor: activeColor, borderWidth: selectWrapperBorderWidth, background: 'transparent', lineDash: [4, 4] };
|
|
113
122
|
drawVertexes(ctx, calcViewVertexes(vertexes, opts), wrapperOpts);
|
|
114
123
|
}
|
|
115
124
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CoreEventMap } from '@idraw/types';
|
|
1
|
+
import type { CoreEventMap, MiddlewareSelectorConfig } from '@idraw/types';
|
|
2
2
|
import type { BoardMiddleware, ActionType, DeepSelectorSharedStorage } from './types';
|
|
3
3
|
import { middlewareEventSelect, middlewareEventSelectClear, middlewareEventSelectInGroup, middlewareEventSnapToGrid, keyActionType, keyResizeType, keyGroupQueue, keyHoverElement, keySelectedElementList } from './config';
|
|
4
4
|
export { keySelectedElementList, keyHoverElement, keyActionType, keyResizeType, keyGroupQueue };
|
|
5
5
|
export type { DeepSelectorSharedStorage, ActionType };
|
|
6
6
|
export { middlewareEventSelect, middlewareEventSelectClear, middlewareEventSelectInGroup, middlewareEventSnapToGrid };
|
|
7
|
-
export declare const MiddlewareSelector: BoardMiddleware<DeepSelectorSharedStorage, CoreEventMap>;
|
|
7
|
+
export declare const MiddlewareSelector: BoardMiddleware<DeepSelectorSharedStorage, CoreEventMap, MiddlewareSelectorConfig>;
|
|
@@ -2,14 +2,17 @@ import { is, calcElementsViewInfo, calcElementVertexesInGroup, calcElementQueueV
|
|
|
2
2
|
import { drawHoverVertexesWrapper, drawLockVertexesWrapper, drawArea, drawListArea, drawGroupQueueVertexesWrappers, drawSelectedElementControllersVertexes } from './draw-wrapper';
|
|
3
3
|
import { drawReferenceLines } from './draw-reference';
|
|
4
4
|
import { getPointTarget, resizeElement, rotateElement, getSelectedListArea, calcSelectedElementsArea, isElementInGroup, isPointInViewActiveGroup, calcMoveInGroup } from './util';
|
|
5
|
-
import { middlewareEventSelect, middlewareEventSelectClear, middlewareEventSelectInGroup, middlewareEventSnapToGrid, keyActionType, keyResizeType, keyAreaStart, keyAreaEnd, keyGroupQueue, keyGroupQueueVertexesList, keyHoverElement, keyHoverElementVertexes, keySelectedElementList, keySelectedElementListVertexes, keySelectedElementController, keySelectedElementPosition, keyIsMoving, keyEnableSelectInGroup, keyEnableSnapToGrid, controllerSize } from './config';
|
|
5
|
+
import { middlewareEventSelect, middlewareEventSelectClear, middlewareEventSelectInGroup, middlewareEventSnapToGrid, keyActionType, keyResizeType, keyAreaStart, keyAreaEnd, keyGroupQueue, keyGroupQueueVertexesList, keyHoverElement, keyHoverElementVertexes, keySelectedElementList, keySelectedElementListVertexes, keySelectedElementController, keySelectedElementPosition, keyIsMoving, keyEnableSelectInGroup, keyEnableSnapToGrid, controllerSize, defaultStyle } from './config';
|
|
6
6
|
import { calcReferenceInfo } from './reference';
|
|
7
7
|
import { middlewareEventTextEdit } from '../text-editor';
|
|
8
8
|
import { eventChange } from '../../config';
|
|
9
9
|
import { keyLayoutIsSelected } from '../layout-selector';
|
|
10
10
|
export { keySelectedElementList, keyHoverElement, keyActionType, keyResizeType, keyGroupQueue };
|
|
11
11
|
export { middlewareEventSelect, middlewareEventSelectClear, middlewareEventSelectInGroup, middlewareEventSnapToGrid };
|
|
12
|
-
export const MiddlewareSelector = (opts) => {
|
|
12
|
+
export const MiddlewareSelector = (opts, config) => {
|
|
13
|
+
const innerConfig = Object.assign(Object.assign({}, defaultStyle), config);
|
|
14
|
+
const { activeColor, activeAreaColor, lockedColor, referenceColor } = innerConfig;
|
|
15
|
+
const style = { activeColor, activeAreaColor, lockedColor, referenceColor };
|
|
13
16
|
const { viewer, sharer, boardContent, calculator, eventHub } = opts;
|
|
14
17
|
const { overlayContext } = boardContent;
|
|
15
18
|
let prevPoint = null;
|
|
@@ -607,7 +610,7 @@ export const MiddlewareSelector = (opts) => {
|
|
|
607
610
|
const groupQueueVertexesList = sharedStore[keyGroupQueueVertexesList];
|
|
608
611
|
const isMoving = sharedStore[keyIsMoving];
|
|
609
612
|
const enableSnapToGrid = sharedStore[keyEnableSnapToGrid];
|
|
610
|
-
const drawBaseOpts = { calculator, viewScaleInfo, viewSizeInfo };
|
|
613
|
+
const drawBaseOpts = { calculator, viewScaleInfo, viewSizeInfo, style };
|
|
611
614
|
const selectedElementController = elem
|
|
612
615
|
? calcElementSizeController(elem, {
|
|
613
616
|
groupQueue,
|
|
@@ -624,14 +627,14 @@ export const MiddlewareSelector = (opts) => {
|
|
|
624
627
|
groupQueue,
|
|
625
628
|
controllerSize: 10,
|
|
626
629
|
viewScaleInfo
|
|
627
|
-
}) }));
|
|
630
|
+
}), style }));
|
|
628
631
|
}
|
|
629
632
|
else {
|
|
630
633
|
drawHoverVertexesWrapper(overlayContext, hoverElementVertexes, drawBaseOpts);
|
|
631
634
|
}
|
|
632
635
|
}
|
|
633
636
|
if (!isLock && elem && ['select', 'drag', 'resize'].includes(actionType)) {
|
|
634
|
-
drawSelectedElementControllersVertexes(overlayContext, selectedElementController, Object.assign(Object.assign({}, drawBaseOpts), { element: elem, calculator, hideControllers: !!isMoving && actionType === 'drag' }));
|
|
637
|
+
drawSelectedElementControllersVertexes(overlayContext, selectedElementController, Object.assign(Object.assign({}, drawBaseOpts), { element: elem, calculator, hideControllers: !!isMoving && actionType === 'drag', style }));
|
|
635
638
|
if (actionType === 'drag') {
|
|
636
639
|
if (enableSnapToGrid === true) {
|
|
637
640
|
const referenceInfo = calcReferenceInfo(elem.uuid, {
|
|
@@ -646,7 +649,8 @@ export const MiddlewareSelector = (opts) => {
|
|
|
646
649
|
if (offsetX === 0 || offsetY === 0) {
|
|
647
650
|
drawReferenceLines(overlayContext, {
|
|
648
651
|
xLines,
|
|
649
|
-
yLines
|
|
652
|
+
yLines,
|
|
653
|
+
style
|
|
650
654
|
});
|
|
651
655
|
}
|
|
652
656
|
}
|
|
@@ -661,14 +665,14 @@ export const MiddlewareSelector = (opts) => {
|
|
|
661
665
|
groupQueue,
|
|
662
666
|
controllerSize: 10,
|
|
663
667
|
viewScaleInfo
|
|
664
|
-
}) }));
|
|
668
|
+
}), style }));
|
|
665
669
|
}
|
|
666
670
|
else {
|
|
667
671
|
drawHoverVertexesWrapper(overlayContext, hoverElementVertexes, drawBaseOpts);
|
|
668
672
|
}
|
|
669
673
|
}
|
|
670
674
|
if (!isLock && elem && ['select', 'drag', 'resize'].includes(actionType)) {
|
|
671
|
-
drawSelectedElementControllersVertexes(overlayContext, selectedElementController, Object.assign(Object.assign({}, drawBaseOpts), { element: elem, calculator, hideControllers: !!isMoving && actionType === 'drag' }));
|
|
675
|
+
drawSelectedElementControllersVertexes(overlayContext, selectedElementController, Object.assign(Object.assign({}, drawBaseOpts), { element: elem, calculator, hideControllers: !!isMoving && actionType === 'drag', style }));
|
|
672
676
|
if (actionType === 'drag') {
|
|
673
677
|
if (enableSnapToGrid === true) {
|
|
674
678
|
const referenceInfo = calcReferenceInfo(elem.uuid, {
|
|
@@ -683,7 +687,8 @@ export const MiddlewareSelector = (opts) => {
|
|
|
683
687
|
if (offsetX === 0 || offsetY === 0) {
|
|
684
688
|
drawReferenceLines(overlayContext, {
|
|
685
689
|
xLines,
|
|
686
|
-
yLines
|
|
690
|
+
yLines,
|
|
691
|
+
style
|
|
687
692
|
});
|
|
688
693
|
}
|
|
689
694
|
}
|
|
@@ -691,7 +696,7 @@ export const MiddlewareSelector = (opts) => {
|
|
|
691
696
|
}
|
|
692
697
|
}
|
|
693
698
|
else if (actionType === 'area' && areaStart && areaEnd) {
|
|
694
|
-
drawArea(overlayContext, { start: areaStart, end: areaEnd });
|
|
699
|
+
drawArea(overlayContext, { start: areaStart, end: areaEnd, style });
|
|
695
700
|
}
|
|
696
701
|
else if (['drag-list', 'drag-list-end'].includes(actionType)) {
|
|
697
702
|
const listAreaSize = calcSelectedElementsArea(getActiveElements(), {
|
|
@@ -700,7 +705,7 @@ export const MiddlewareSelector = (opts) => {
|
|
|
700
705
|
calculator
|
|
701
706
|
});
|
|
702
707
|
if (listAreaSize) {
|
|
703
|
-
drawListArea(overlayContext, { areaSize: listAreaSize });
|
|
708
|
+
drawListArea(overlayContext, { areaSize: listAreaSize, style });
|
|
704
709
|
}
|
|
705
710
|
}
|
|
706
711
|
}
|