js-draw 0.5.0 → 0.7.0
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/.firebase/hosting.ZG9jcw.cache +338 -0
- package/.github/ISSUE_TEMPLATE/translation.md +1 -1
- package/CHANGELOG.md +19 -0
- package/dist/bundle.js +1 -1
- package/dist/src/Editor.d.ts +8 -6
- package/dist/src/Editor.js +8 -4
- package/dist/src/EditorImage.d.ts +3 -0
- package/dist/src/EditorImage.js +7 -0
- package/dist/src/SVGLoader.js +7 -8
- package/dist/src/components/AbstractComponent.d.ts +1 -0
- package/dist/src/components/AbstractComponent.js +4 -0
- package/dist/src/components/SVGGlobalAttributesObject.d.ts +1 -0
- package/dist/src/components/SVGGlobalAttributesObject.js +3 -0
- package/dist/src/components/Stroke.js +1 -0
- package/dist/src/components/Text.d.ts +11 -8
- package/dist/src/components/Text.js +63 -20
- package/dist/src/components/UnknownSVGObject.d.ts +1 -0
- package/dist/src/components/UnknownSVGObject.js +3 -0
- package/dist/src/components/builders/FreehandLineBuilder.d.ts +9 -2
- package/dist/src/components/builders/FreehandLineBuilder.js +129 -30
- package/dist/src/components/lib.d.ts +2 -2
- package/dist/src/components/lib.js +2 -2
- package/dist/src/rendering/renderers/CanvasRenderer.js +2 -2
- package/dist/src/rendering/renderers/SVGRenderer.d.ts +2 -0
- package/dist/src/rendering/renderers/SVGRenderer.js +49 -22
- package/dist/src/testing/beforeEachFile.js +4 -0
- package/dist/src/toolbar/HTMLToolbar.js +2 -3
- package/dist/src/toolbar/IconProvider.d.ts +30 -0
- package/dist/src/toolbar/IconProvider.js +417 -0
- package/dist/src/toolbar/lib.d.ts +1 -1
- package/dist/src/toolbar/lib.js +1 -2
- package/dist/src/toolbar/localization.d.ts +0 -1
- package/dist/src/toolbar/localization.js +0 -1
- package/dist/src/toolbar/makeColorInput.js +1 -2
- package/dist/src/toolbar/widgets/BaseWidget.js +1 -2
- package/dist/src/toolbar/widgets/EraserToolWidget.js +1 -2
- package/dist/src/toolbar/widgets/HandToolWidget.d.ts +5 -3
- package/dist/src/toolbar/widgets/HandToolWidget.js +35 -12
- package/dist/src/toolbar/widgets/PenToolWidget.js +10 -8
- package/dist/src/toolbar/widgets/SelectionToolWidget.d.ts +3 -0
- package/dist/src/toolbar/widgets/SelectionToolWidget.js +20 -7
- package/dist/src/toolbar/widgets/TextToolWidget.js +1 -2
- package/dist/src/tools/PanZoom.d.ts +1 -1
- package/dist/src/tools/PanZoom.js +4 -1
- package/dist/src/tools/PasteHandler.js +2 -22
- package/dist/src/tools/SelectionTool/SelectionTool.d.ts +3 -0
- package/dist/src/tools/SelectionTool/SelectionTool.js +66 -3
- package/dist/src/tools/TextTool.d.ts +4 -0
- package/dist/src/tools/TextTool.js +73 -15
- package/dist/src/tools/ToolController.js +1 -0
- package/dist/src/tools/localization.d.ts +1 -0
- package/dist/src/tools/localization.js +1 -0
- package/package.json +1 -1
- package/src/Editor.toSVG.test.ts +27 -0
- package/src/Editor.ts +15 -9
- package/src/EditorImage.ts +9 -0
- package/src/SVGLoader.test.ts +57 -0
- package/src/SVGLoader.ts +9 -10
- package/src/components/AbstractComponent.ts +5 -0
- package/src/components/SVGGlobalAttributesObject.ts +4 -0
- package/src/components/Stroke.ts +1 -0
- package/src/components/Text.test.ts +3 -18
- package/src/components/Text.ts +78 -25
- package/src/components/UnknownSVGObject.ts +4 -0
- package/src/components/builders/FreehandLineBuilder.ts +162 -34
- package/src/components/lib.ts +3 -3
- package/src/rendering/renderers/CanvasRenderer.ts +2 -2
- package/src/rendering/renderers/SVGRenderer.ts +50 -24
- package/src/testing/beforeEachFile.ts +6 -1
- package/src/toolbar/HTMLToolbar.ts +2 -3
- package/src/toolbar/IconProvider.ts +480 -0
- package/src/toolbar/lib.ts +1 -1
- package/src/toolbar/localization.ts +0 -2
- package/src/toolbar/makeColorInput.ts +1 -2
- package/src/toolbar/widgets/BaseWidget.ts +1 -2
- package/src/toolbar/widgets/EraserToolWidget.ts +1 -2
- package/src/toolbar/widgets/HandToolWidget.ts +42 -20
- package/src/toolbar/widgets/PenToolWidget.ts +11 -8
- package/src/toolbar/widgets/SelectionToolWidget.ts +24 -8
- package/src/toolbar/widgets/TextToolWidget.ts +1 -2
- package/src/tools/PanZoom.ts +4 -1
- package/src/tools/PasteHandler.ts +2 -24
- package/src/tools/SelectionTool/SelectionTool.css +1 -0
- package/src/tools/SelectionTool/SelectionTool.test.ts +40 -0
- package/src/tools/SelectionTool/SelectionTool.ts +73 -4
- package/src/tools/TextTool.ts +82 -17
- package/src/tools/ToolController.ts +1 -0
- package/src/tools/localization.ts +4 -0
- package/typedoc.json +5 -1
- package/dist/src/toolbar/icons.d.ts +0 -20
- package/dist/src/toolbar/icons.js +0 -385
- package/src/toolbar/icons.ts +0 -443
package/src/toolbar/icons.ts
DELETED
@@ -1,443 +0,0 @@
|
|
1
|
-
import Color4 from '../Color4';
|
2
|
-
import { ComponentBuilderFactory } from '../components/builders/types';
|
3
|
-
import { TextStyle } from '../components/Text';
|
4
|
-
import EventDispatcher from '../EventDispatcher';
|
5
|
-
import { Vec2 } from '../math/Vec2';
|
6
|
-
import SVGRenderer from '../rendering/renderers/SVGRenderer';
|
7
|
-
import Pen from '../tools/Pen';
|
8
|
-
import { StrokeDataPoint } from '../types';
|
9
|
-
import Viewport from '../Viewport';
|
10
|
-
|
11
|
-
const svgNamespace = 'http://www.w3.org/2000/svg';
|
12
|
-
const iconColorFill = `
|
13
|
-
style='fill: var(--icon-color);'
|
14
|
-
`;
|
15
|
-
const iconColorStrokeFill = `
|
16
|
-
style='fill: var(--icon-color); stroke: var(--icon-color);'
|
17
|
-
`;
|
18
|
-
const checkerboardPatternDef = `
|
19
|
-
<pattern
|
20
|
-
id='checkerboard'
|
21
|
-
viewBox='0,0,10,10'
|
22
|
-
width='20%'
|
23
|
-
height='20%'
|
24
|
-
patternUnits='userSpaceOnUse'
|
25
|
-
>
|
26
|
-
<rect x=0 y=0 width=10 height=10 fill='white'/>
|
27
|
-
<rect x=0 y=0 width=5 height=5 fill='gray'/>
|
28
|
-
<rect x=5 y=5 width=5 height=5 fill='gray'/>
|
29
|
-
</pattern>
|
30
|
-
`;
|
31
|
-
const checkerboardPatternRef = 'url(#checkerboard)';
|
32
|
-
|
33
|
-
export const makeUndoIcon = () => {
|
34
|
-
return makeRedoIcon(true);
|
35
|
-
};
|
36
|
-
|
37
|
-
export const makeRedoIcon = (mirror: boolean = false) => {
|
38
|
-
const icon = document.createElementNS(svgNamespace, 'svg');
|
39
|
-
icon.innerHTML = `
|
40
|
-
<style>
|
41
|
-
.toolbar-svg-undo-redo-icon {
|
42
|
-
stroke: var(--icon-color);
|
43
|
-
stroke-width: 12;
|
44
|
-
stroke-linejoin: round;
|
45
|
-
stroke-linecap: round;
|
46
|
-
fill: none;
|
47
|
-
|
48
|
-
transform-origin: center;
|
49
|
-
}
|
50
|
-
</style>
|
51
|
-
<path
|
52
|
-
d='M20,20 A15,15 0 0 1 70,80 L80,90 L60,70 L65,90 L87,90 L65,80'
|
53
|
-
class='toolbar-svg-undo-redo-icon'
|
54
|
-
style='${mirror ? 'transform: scale(-1, 1);' : ''}'/>
|
55
|
-
`;
|
56
|
-
icon.setAttribute('viewBox', '0 0 100 100');
|
57
|
-
return icon;
|
58
|
-
};
|
59
|
-
|
60
|
-
export const makeDropdownIcon = () => {
|
61
|
-
const icon = document.createElementNS(svgNamespace, 'svg');
|
62
|
-
icon.innerHTML = `
|
63
|
-
<g>
|
64
|
-
<path
|
65
|
-
d='M5,10 L50,90 L95,10 Z'
|
66
|
-
${iconColorFill}
|
67
|
-
/>
|
68
|
-
</g>
|
69
|
-
`;
|
70
|
-
icon.setAttribute('viewBox', '0 0 100 100');
|
71
|
-
return icon;
|
72
|
-
};
|
73
|
-
|
74
|
-
export const makeEraserIcon = () => {
|
75
|
-
const icon = document.createElementNS(svgNamespace, 'svg');
|
76
|
-
|
77
|
-
// Draw an eraser-like shape
|
78
|
-
icon.innerHTML = `
|
79
|
-
<g>
|
80
|
-
<rect x=10 y=50 width=80 height=30 rx=10 fill='pink' />
|
81
|
-
<rect
|
82
|
-
x=10 y=10 width=80 height=50
|
83
|
-
${iconColorFill}
|
84
|
-
/>
|
85
|
-
</g>
|
86
|
-
`;
|
87
|
-
icon.setAttribute('viewBox', '0 0 100 100');
|
88
|
-
return icon;
|
89
|
-
};
|
90
|
-
|
91
|
-
export const makeSelectionIcon = () => {
|
92
|
-
const icon = document.createElementNS(svgNamespace, 'svg');
|
93
|
-
|
94
|
-
// Draw a cursor-like shape
|
95
|
-
icon.innerHTML = `
|
96
|
-
<g>
|
97
|
-
<rect x=10 y=10 width=70 height=70 fill='pink' stroke='black'/>
|
98
|
-
<rect x=75 y=75 width=10 height=10 fill='white' stroke='black'/>
|
99
|
-
</g>
|
100
|
-
`;
|
101
|
-
icon.setAttribute('viewBox', '0 0 100 100');
|
102
|
-
|
103
|
-
return icon;
|
104
|
-
};
|
105
|
-
|
106
|
-
const pathIcon = (
|
107
|
-
pathData: string,
|
108
|
-
fill: string = 'var(--icon-color)',
|
109
|
-
strokeColor: string = 'none',
|
110
|
-
strokeWidth: string = '0px',
|
111
|
-
) => {
|
112
|
-
const icon = document.createElementNS(svgNamespace, 'svg');
|
113
|
-
const path = document.createElementNS(svgNamespace, 'path');
|
114
|
-
path.setAttribute('d', pathData);
|
115
|
-
path.style.fill = fill;
|
116
|
-
path.style.stroke = strokeColor;
|
117
|
-
path.style.strokeWidth = strokeWidth;
|
118
|
-
icon.appendChild(path);
|
119
|
-
icon.setAttribute('viewBox', '0 0 100 100');
|
120
|
-
|
121
|
-
return icon;
|
122
|
-
};
|
123
|
-
|
124
|
-
export const makeHandToolIcon = () => {
|
125
|
-
const fill = 'none';
|
126
|
-
const strokeColor = 'var(--icon-color)';
|
127
|
-
const strokeWidth = '3';
|
128
|
-
|
129
|
-
// Draw a cursor-like shape (like some of the other icons, made with Inkscape)
|
130
|
-
return pathIcon(`
|
131
|
-
m 10,60
|
132
|
-
5,30
|
133
|
-
H 90
|
134
|
-
V 30
|
135
|
-
C 90,20 75,20 75,30
|
136
|
-
V 60
|
137
|
-
20
|
138
|
-
C 75,10 60,10 60,20
|
139
|
-
V 60
|
140
|
-
15
|
141
|
-
C 60,5 45,5 45,15
|
142
|
-
V 60
|
143
|
-
25
|
144
|
-
C 45,15 30,15 30,25
|
145
|
-
V 60
|
146
|
-
75
|
147
|
-
L 25,60
|
148
|
-
C 20,45 10,50 10,60
|
149
|
-
Z
|
150
|
-
`, fill, strokeColor, strokeWidth);
|
151
|
-
};
|
152
|
-
|
153
|
-
export const makeTouchPanningIcon = () => {
|
154
|
-
const fill = 'none';
|
155
|
-
const strokeColor = 'var(--icon-color)';
|
156
|
-
const strokeWidth = '3';
|
157
|
-
|
158
|
-
return pathIcon(`
|
159
|
-
M 5,5.5
|
160
|
-
V 17.2
|
161
|
-
L 16.25,5.46
|
162
|
-
Z
|
163
|
-
|
164
|
-
m 33.75,0
|
165
|
-
L 50,17
|
166
|
-
V 5.5
|
167
|
-
Z
|
168
|
-
|
169
|
-
M 5,40.7
|
170
|
-
v 11.7
|
171
|
-
h 11.25
|
172
|
-
z
|
173
|
-
|
174
|
-
M 26,19
|
175
|
-
C 19.8,19.4 17.65,30.4 21.9,34.8
|
176
|
-
L 50,70
|
177
|
-
H 27.5
|
178
|
-
c -11.25,0 -11.25,17.6 0,17.6
|
179
|
-
H 61.25
|
180
|
-
C 94.9,87.8 95,87.6 95,40.7 78.125,23 67,29 55.6,46.5
|
181
|
-
L 33.1,23
|
182
|
-
C 30.3125,20.128192 27.9,19 25.830078,19.119756
|
183
|
-
Z
|
184
|
-
`, fill, strokeColor, strokeWidth);
|
185
|
-
};
|
186
|
-
|
187
|
-
export const makeAllDevicePanningIcon = () => {
|
188
|
-
const fill = 'none';
|
189
|
-
const strokeColor = 'var(--icon-color)';
|
190
|
-
const strokeWidth = '3';
|
191
|
-
return pathIcon(`
|
192
|
-
M 5 5
|
193
|
-
L 5 17.5
|
194
|
-
17.5 5
|
195
|
-
5 5
|
196
|
-
z
|
197
|
-
|
198
|
-
M 42.5 5
|
199
|
-
L 55 17.5
|
200
|
-
55 5
|
201
|
-
42.5 5
|
202
|
-
z
|
203
|
-
|
204
|
-
M 70 10
|
205
|
-
L 70 21
|
206
|
-
61 15
|
207
|
-
55.5 23
|
208
|
-
66 30
|
209
|
-
56 37
|
210
|
-
61 45
|
211
|
-
70 39
|
212
|
-
70 50
|
213
|
-
80 50
|
214
|
-
80 39
|
215
|
-
89 45
|
216
|
-
95 36
|
217
|
-
84 30
|
218
|
-
95 23
|
219
|
-
89 15
|
220
|
-
80 21
|
221
|
-
80 10
|
222
|
-
70 10
|
223
|
-
z
|
224
|
-
|
225
|
-
M 27.5 26.25
|
226
|
-
L 27.5 91.25
|
227
|
-
L 43.75 83.125
|
228
|
-
L 52 99
|
229
|
-
L 68 91
|
230
|
-
L 60 75
|
231
|
-
L 76.25 66.875
|
232
|
-
L 27.5 26.25
|
233
|
-
z
|
234
|
-
|
235
|
-
M 5 42.5
|
236
|
-
L 5 55
|
237
|
-
L 17.5 55
|
238
|
-
L 5 42.5
|
239
|
-
z
|
240
|
-
`, fill, strokeColor, strokeWidth);
|
241
|
-
};
|
242
|
-
|
243
|
-
export const makeZoomIcon = () => {
|
244
|
-
const icon = document.createElementNS(svgNamespace, 'svg');
|
245
|
-
icon.setAttribute('viewBox', '0 0 100 100');
|
246
|
-
|
247
|
-
const addTextNode = (text: string, x: number, y: number) => {
|
248
|
-
const textNode = document.createElementNS(svgNamespace, 'text');
|
249
|
-
textNode.appendChild(document.createTextNode(text));
|
250
|
-
textNode.setAttribute('x', x.toString());
|
251
|
-
textNode.setAttribute('y', y.toString());
|
252
|
-
textNode.style.textAlign = 'center';
|
253
|
-
textNode.style.textAnchor = 'middle';
|
254
|
-
textNode.style.fontSize = '55px';
|
255
|
-
textNode.style.fill = 'var(--icon-color)';
|
256
|
-
textNode.style.fontFamily = 'monospace';
|
257
|
-
|
258
|
-
icon.appendChild(textNode);
|
259
|
-
};
|
260
|
-
|
261
|
-
addTextNode('+', 40, 45);
|
262
|
-
addTextNode('-', 70, 75);
|
263
|
-
|
264
|
-
return icon;
|
265
|
-
};
|
266
|
-
|
267
|
-
export const makeTextIcon = (textStyle: TextStyle) => {
|
268
|
-
const icon = document.createElementNS(svgNamespace, 'svg');
|
269
|
-
icon.setAttribute('viewBox', '0 0 100 100');
|
270
|
-
|
271
|
-
const textNode = document.createElementNS(svgNamespace, 'text');
|
272
|
-
textNode.appendChild(document.createTextNode('T'));
|
273
|
-
|
274
|
-
textNode.style.fontFamily = textStyle.fontFamily;
|
275
|
-
textNode.style.fontWeight = textStyle.fontWeight ?? '';
|
276
|
-
textNode.style.fontVariant = textStyle.fontVariant ?? '';
|
277
|
-
textNode.style.fill = textStyle.renderingStyle.fill.toHexString();
|
278
|
-
|
279
|
-
textNode.style.textAnchor = 'middle';
|
280
|
-
textNode.setAttribute('x', '50');
|
281
|
-
textNode.setAttribute('y', '75');
|
282
|
-
textNode.style.fontSize = '65px';
|
283
|
-
textNode.style.filter = 'drop-shadow(0px 0px 10px var(--primary-shadow-color))';
|
284
|
-
|
285
|
-
icon.appendChild(textNode);
|
286
|
-
|
287
|
-
return icon;
|
288
|
-
};
|
289
|
-
|
290
|
-
export const makePenIcon = (tipThickness: number, color: string|Color4) => {
|
291
|
-
if (color instanceof Color4) {
|
292
|
-
color = color.toHexString();
|
293
|
-
}
|
294
|
-
|
295
|
-
const icon = document.createElementNS(svgNamespace, 'svg');
|
296
|
-
icon.setAttribute('viewBox', '0 0 100 100');
|
297
|
-
|
298
|
-
const halfThickness = tipThickness / 2;
|
299
|
-
|
300
|
-
// Draw a pen-like shape
|
301
|
-
const primaryStrokeTipPath = `M14,63 L${50 - halfThickness},95 L${50 + halfThickness},90 L88,60 Z`;
|
302
|
-
const backgroundStrokeTipPath = `M14,63 L${50 - halfThickness},85 L${50 + halfThickness},83 L88,60 Z`;
|
303
|
-
icon.innerHTML = `
|
304
|
-
<defs>
|
305
|
-
${checkerboardPatternDef}
|
306
|
-
</defs>
|
307
|
-
<g>
|
308
|
-
<!-- Pen grip -->
|
309
|
-
<path
|
310
|
-
d='M10,10 L90,10 L90,60 L${50 + halfThickness},80 L${50 - halfThickness},80 L10,60 Z'
|
311
|
-
${iconColorStrokeFill}
|
312
|
-
/>
|
313
|
-
</g>
|
314
|
-
<g>
|
315
|
-
<!-- Checkerboard background for slightly transparent pens -->
|
316
|
-
<path d='${backgroundStrokeTipPath}' fill='${checkerboardPatternRef}'/>
|
317
|
-
|
318
|
-
<!-- Actual pen tip -->
|
319
|
-
<path
|
320
|
-
d='${primaryStrokeTipPath}'
|
321
|
-
fill='${color}'
|
322
|
-
stroke='${color}'
|
323
|
-
/>
|
324
|
-
</g>
|
325
|
-
`;
|
326
|
-
return icon;
|
327
|
-
};
|
328
|
-
|
329
|
-
export const makeIconFromFactory = (pen: Pen, factory: ComponentBuilderFactory) => {
|
330
|
-
const toolThickness = pen.getThickness();
|
331
|
-
|
332
|
-
const nowTime = (new Date()).getTime();
|
333
|
-
const startPoint: StrokeDataPoint = {
|
334
|
-
pos: Vec2.of(10, 10),
|
335
|
-
width: toolThickness / 5,
|
336
|
-
color: pen.getColor(),
|
337
|
-
time: nowTime - 100,
|
338
|
-
};
|
339
|
-
const endPoint: StrokeDataPoint = {
|
340
|
-
pos: Vec2.of(90, 90),
|
341
|
-
width: toolThickness / 5,
|
342
|
-
color: pen.getColor(),
|
343
|
-
time: nowTime,
|
344
|
-
};
|
345
|
-
|
346
|
-
const viewport = new Viewport(new EventDispatcher());
|
347
|
-
const builder = factory(startPoint, viewport);
|
348
|
-
builder.addPoint(endPoint);
|
349
|
-
|
350
|
-
const icon = document.createElementNS(svgNamespace, 'svg');
|
351
|
-
icon.setAttribute('viewBox', '0 0 100 100');
|
352
|
-
viewport.updateScreenSize(Vec2.of(100, 100));
|
353
|
-
|
354
|
-
const renderer = new SVGRenderer(icon, viewport);
|
355
|
-
builder.preview(renderer);
|
356
|
-
|
357
|
-
return icon;
|
358
|
-
};
|
359
|
-
|
360
|
-
export const makePipetteIcon = (color?: Color4) => {
|
361
|
-
const icon = document.createElementNS(svgNamespace, 'svg');
|
362
|
-
const pipette = document.createElementNS(svgNamespace, 'path');
|
363
|
-
|
364
|
-
pipette.setAttribute('d', `
|
365
|
-
M 47,6
|
366
|
-
C 35,5 25,15 35,30
|
367
|
-
c -9.2,1.3 -15,0 -15,3
|
368
|
-
0,2 5,5 15,7
|
369
|
-
V 81
|
370
|
-
L 40,90
|
371
|
-
h 6
|
372
|
-
L 40,80
|
373
|
-
V 40
|
374
|
-
h 15
|
375
|
-
v 40
|
376
|
-
l -6,10
|
377
|
-
h 6
|
378
|
-
l 5,-9.2
|
379
|
-
V 40
|
380
|
-
C 70,38 75,35 75,33
|
381
|
-
75,30 69.2,31.2 60,30
|
382
|
-
65,15 65,5 47,6
|
383
|
-
Z
|
384
|
-
`);
|
385
|
-
pipette.style.fill = 'var(--icon-color)';
|
386
|
-
|
387
|
-
if (color) {
|
388
|
-
const defs = document.createElementNS(svgNamespace, 'defs');
|
389
|
-
defs.innerHTML = checkerboardPatternDef;
|
390
|
-
icon.appendChild(defs);
|
391
|
-
|
392
|
-
const fluidBackground = document.createElementNS(svgNamespace, 'path');
|
393
|
-
const fluid = document.createElementNS(svgNamespace, 'path');
|
394
|
-
|
395
|
-
const fluidPathData = `
|
396
|
-
m 40,50 c 5,5 10,0 15,-5 V 80 L 50,90 H 45 L 40,80 Z
|
397
|
-
`;
|
398
|
-
|
399
|
-
fluid.setAttribute('d', fluidPathData);
|
400
|
-
fluidBackground.setAttribute('d', fluidPathData);
|
401
|
-
|
402
|
-
fluid.style.fill = color.toHexString();
|
403
|
-
fluidBackground.style.fill = checkerboardPatternRef;
|
404
|
-
|
405
|
-
icon.appendChild(fluidBackground);
|
406
|
-
icon.appendChild(fluid);
|
407
|
-
}
|
408
|
-
icon.appendChild(pipette);
|
409
|
-
|
410
|
-
icon.setAttribute('viewBox', '0 0 100 100');
|
411
|
-
return icon;
|
412
|
-
};
|
413
|
-
|
414
|
-
export const makeResizeViewportIcon = () => {
|
415
|
-
return pathIcon(`
|
416
|
-
M 75 5 75 10 90 10 90 25 95 25 95 5 75 5 z
|
417
|
-
M 15 15 15 30 20 30 20 20 30 20 30 15 15 15 z
|
418
|
-
M 84 15 82 17 81 16 81 20 85 20 84 19 86 17 84 15 z
|
419
|
-
M 26 24 24 26 26 28 25 29 29 29 29 25 28 26 26 24 z
|
420
|
-
M 25 71 26 72 24 74 26 76 28 74 29 75 29 71 25 71 z
|
421
|
-
M 15 75 15 85 25 85 25 80 20 80 20 75 15 75 z
|
422
|
-
M 90 75 90 90 75 90 75 95 95 95 95 75 90 75 z
|
423
|
-
M 81 81 81 85 82 84 84 86 86 84 84 82 85 81 81 81 z
|
424
|
-
`);
|
425
|
-
};
|
426
|
-
|
427
|
-
export const makeDuplicateSelectionIcon = () => {
|
428
|
-
return pathIcon(`
|
429
|
-
M 45,10 45,55 90,55 90,10 45,10 z
|
430
|
-
M 10,25 10,90 70,90 70,60 40,60 40,25 10,25 z
|
431
|
-
`);
|
432
|
-
};
|
433
|
-
|
434
|
-
export const makeDeleteSelectionIcon = () => {
|
435
|
-
const strokeWidth = '5px';
|
436
|
-
const strokeColor = 'var(--icon-color)';
|
437
|
-
const fillColor = 'none';
|
438
|
-
|
439
|
-
return pathIcon(`
|
440
|
-
M 10,10 90,90
|
441
|
-
M 10,90 90,10
|
442
|
-
`, fillColor, strokeColor, strokeWidth);
|
443
|
-
};
|