in progress
This commit is contained in:
@@ -28,9 +28,7 @@ exports[`use various parts of svg-edit > check tool_fhpath #0`] = `
|
|||||||
fill-opacity="1"
|
fill-opacity="1"
|
||||||
stroke-opacity="1"
|
stroke-opacity="1"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer"><title>Layer 1</title></g>
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
|
||||||
</g>
|
|
||||||
</svg>
|
</svg>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
@@ -26,14 +26,13 @@ exports[`use all parts of svg-edit > check tool_circle #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<circle
|
<circle
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
opacity="0.5"
|
opacity="0.5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
cx="150"
|
cx="150"
|
||||||
cy="150"
|
cy="150"
|
||||||
r="111.80339887498948"
|
r="111.80339887498948"
|
||||||
@@ -63,13 +62,12 @@ exports[`use all parts of svg-edit > check tool_fhellipse #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<circle
|
<circle
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
cx="150"
|
cx="150"
|
||||||
cy="150"
|
cy="150"
|
||||||
r="111.80339887498948"
|
r="111.80339887498948"
|
||||||
@@ -82,7 +80,6 @@ exports[`use all parts of svg-edit > check tool_fhellipse #0`] = `
|
|||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
opacity="0.5"
|
opacity="0.5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
cx="299"
|
cx="299"
|
||||||
cy="169"
|
cy="169"
|
||||||
rx="60"
|
rx="60"
|
||||||
@@ -113,13 +110,12 @@ exports[`use all parts of svg-edit > check tool_ellipse #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<circle
|
<circle
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
cx="150"
|
cx="150"
|
||||||
cy="150"
|
cy="150"
|
||||||
r="111.80339887498948"
|
r="111.80339887498948"
|
||||||
@@ -131,7 +127,6 @@ exports[`use all parts of svg-edit > check tool_ellipse #0`] = `
|
|||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
cx="299"
|
cx="299"
|
||||||
cy="169"
|
cy="169"
|
||||||
rx="60"
|
rx="60"
|
||||||
@@ -145,7 +140,6 @@ exports[`use all parts of svg-edit > check tool_ellipse #0`] = `
|
|||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
opacity="0.5"
|
opacity="0.5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
cx="114"
|
cx="114"
|
||||||
cy="189"
|
cy="189"
|
||||||
rx="55"
|
rx="55"
|
||||||
@@ -176,13 +170,12 @@ exports[`use all parts of svg-edit > check tool_circle_change_fill_color #0`] =
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<circle
|
<circle
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
cx="150"
|
cx="150"
|
||||||
cy="150"
|
cy="150"
|
||||||
r="111.80339887498948"
|
r="111.80339887498948"
|
||||||
@@ -206,7 +199,6 @@ exports[`use all parts of svg-edit > check tool_circle_change_fill_color #0`] =
|
|||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
cx="114"
|
cx="114"
|
||||||
cy="189"
|
cy="189"
|
||||||
rx="55"
|
rx="55"
|
||||||
@@ -214,6 +206,7 @@ exports[`use all parts of svg-edit > check tool_circle_change_fill_color #0`] =
|
|||||||
id="svg_3"
|
id="svg_3"
|
||||||
fill-opacity="1"
|
fill-opacity="1"
|
||||||
stroke-opacity="1"
|
stroke-opacity="1"
|
||||||
|
transform="matrix(1 0 0 1 0 0)"
|
||||||
></ellipse>
|
></ellipse>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
@@ -26,14 +26,13 @@ exports[`use all parts of svg-edit > check tool_path #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<path
|
<path
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
opacity="0.5"
|
opacity="0.5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
d="M 50 50 L 150 100 L 125 200 L 50 50 z"
|
d="M 50 50 L 150 100 L 125 200 L 50 50 z"
|
||||||
id="svg_1"
|
id="svg_1"
|
||||||
>
|
>
|
||||||
@@ -61,8 +60,8 @@ exports[`use all parts of svg-edit > check tool_path_change_node_xy #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<path
|
<path
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
@@ -88,8 +87,8 @@ exports[`use all parts of svg-edit > check tool_path_change_seg_type #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<path
|
<path
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
@@ -115,8 +114,8 @@ exports[`use all parts of svg-edit > check tool_path_change_clone_node #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<path
|
<path
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
@@ -142,8 +141,8 @@ exports[`use all parts of svg-edit > check tool_path_openclose #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<path
|
<path
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
|
|||||||
@@ -26,14 +26,13 @@ exports[`use all parts of svg-edit > check tool_rect #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<rect
|
<rect
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
opacity="0.5"
|
opacity="0.5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
x="150"
|
x="150"
|
||||||
y="150"
|
y="150"
|
||||||
width="100"
|
width="100"
|
||||||
@@ -64,13 +63,12 @@ exports[`use all parts of svg-edit > check tool_fhrect #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<rect
|
<rect
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
x="150"
|
x="150"
|
||||||
y="150"
|
y="150"
|
||||||
width="100"
|
width="100"
|
||||||
@@ -84,7 +82,6 @@ exports[`use all parts of svg-edit > check tool_fhrect #0`] = `
|
|||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
opacity="0.5"
|
opacity="0.5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
x="350"
|
x="350"
|
||||||
y="230"
|
y="230"
|
||||||
width="120"
|
width="120"
|
||||||
@@ -115,13 +112,12 @@ exports[`use all parts of svg-edit > check tool_square #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<rect
|
<rect
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
x="150"
|
x="150"
|
||||||
y="150"
|
y="150"
|
||||||
width="100"
|
width="100"
|
||||||
@@ -134,7 +130,6 @@ exports[`use all parts of svg-edit > check tool_square #0`] = `
|
|||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
x="350"
|
x="350"
|
||||||
y="230"
|
y="230"
|
||||||
width="120"
|
width="120"
|
||||||
@@ -148,7 +143,6 @@ exports[`use all parts of svg-edit > check tool_square #0`] = `
|
|||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
opacity="0.5"
|
opacity="0.5"
|
||||||
style="pointer-events:inherit"
|
|
||||||
x="225"
|
x="225"
|
||||||
y="300"
|
y="300"
|
||||||
width="50"
|
width="50"
|
||||||
|
|||||||
@@ -26,14 +26,13 @@ exports[`use all parts of svg-edit > check tool_line #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<line
|
<line
|
||||||
fill="none"
|
fill="none"
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
opacity="0.5"
|
opacity="0.5"
|
||||||
style="pointer-events:none"
|
|
||||||
x1="200"
|
x1="200"
|
||||||
y1="200"
|
y1="200"
|
||||||
x2="450"
|
x2="450"
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ exports[`use all parts of svg-edit > check tool_polygon_clone #0`] = `
|
|||||||
y="480"
|
y="480"
|
||||||
viewBox="0 0 640 480"
|
viewBox="0 0 640 480"
|
||||||
>
|
>
|
||||||
<g class="layer" style="pointer-events:all">
|
<g class="layer">
|
||||||
<title style="pointer-events:inherit">Layer 1</title>
|
<title>Layer 1</title>
|
||||||
<polygon
|
<polygon
|
||||||
cx="325"
|
cx="325"
|
||||||
cy="250"
|
cy="250"
|
||||||
@@ -79,7 +79,7 @@ exports[`use all parts of svg-edit > check tool_polygon_clone #0`] = `
|
|||||||
edge="63.333333333333336"
|
edge="63.333333333333336"
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
strokecolor="#000000"
|
strokecolor="#000000"
|
||||||
strokeWidth="5"
|
strokewidth="5"
|
||||||
points="378.87455119562924,250 341.6481518837726,301.23774297708 281.41457251841285,281.6666666666667 281.4145725184128,218.33333333333334 341.6481518837726,198.76225702291998 378.87455119562924,250 "
|
points="378.87455119562924,250 341.6481518837726,301.23774297708 281.41457251841285,281.6666666666667 281.4145725184128,218.33333333333334 341.6481518837726,198.76225702291998 378.87455119562924,250 "
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
@@ -95,7 +95,7 @@ exports[`use all parts of svg-edit > check tool_polygon_clone #0`] = `
|
|||||||
edge="63.333333333333336"
|
edge="63.333333333333336"
|
||||||
fill="#FF0000"
|
fill="#FF0000"
|
||||||
strokecolor="#000000"
|
strokecolor="#000000"
|
||||||
strokeWidth="5"
|
strokewidth="5"
|
||||||
points="398.8745422363281,270 361.6481628417969,321.23773193359375 301.4145812988281,301.6666564941406 301.4145812988281,238.3333282470703 361.6481628417969,218.7622528076172 398.8745422363281,270 "
|
points="398.8745422363281,270 361.6481628417969,321.23773193359375 301.4145812988281,301.6666564941406 301.4145812988281,238.3333282470703 361.6481628417969,218.7622528076172 398.8745422363281,270 "
|
||||||
stroke="#000000"
|
stroke="#000000"
|
||||||
stroke-width="5"
|
stroke-width="5"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ describe('use various parts of svg-edit', function () {
|
|||||||
.trigger('mousedown', 200, 200, { force: true })
|
.trigger('mousedown', 200, 200, { force: true })
|
||||||
.trigger('mousemove', 20, 20, { force: true })
|
.trigger('mousemove', 20, 20, { force: true })
|
||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_text', function () {
|
it('check tool_text', function () {
|
||||||
cy.get('#tool_text')
|
cy.get('#tool_text')
|
||||||
@@ -54,6 +54,8 @@ describe('use various parts of svg-edit', function () {
|
|||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#tool_italic')
|
cy.get('#tool_italic')
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||||
|
cy.wait(500);
|
||||||
testSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_bold', function () {
|
it('check tool_bold', function () {
|
||||||
@@ -72,7 +74,7 @@ describe('use various parts of svg-edit', function () {
|
|||||||
cy.get('#selected_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#selected_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_text_change_font_size', function () {
|
it('check tool_text_change_font_size', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -80,13 +82,13 @@ describe('use various parts of svg-edit', function () {
|
|||||||
cy.get('#font_size').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#font_size').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_text_change_stroke_width', function () {
|
it('check tool_text_change_stroke_width', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_text_change_stoke_fill_color', function () {
|
it('check tool_text_change_stoke_fill_color', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -104,7 +106,7 @@ describe('use various parts of svg-edit', function () {
|
|||||||
cy.get('#fill_color').shadow().find('#color_picker').eq(0)
|
cy.get('#fill_color').shadow().find('#color_picker').eq(0)
|
||||||
.find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0)
|
.find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0)
|
||||||
.find('#Ok').eq(0).click({ force: true });
|
.find('#Ok').eq(0).click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_text_anchor_start', function () {
|
it('check tool_text_anchor_start', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -130,7 +132,7 @@ describe('use various parts of svg-edit', function () {
|
|||||||
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_text_change_blur', function () {
|
it('check tool_text_change_blur', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
@@ -138,7 +140,7 @@ describe('use various parts of svg-edit', function () {
|
|||||||
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_text_change_opacity', function () {
|
it('check tool_text_change_opacity', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
@@ -146,14 +148,14 @@ describe('use various parts of svg-edit', function () {
|
|||||||
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_text_align_to_page', function () {
|
it('check tool_text_align_to_page', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened');
|
cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened');
|
||||||
cy.get('#tool_position').find('se-list-item').eq(2).shadow().find('elix-option').eq(0)
|
cy.get('#tool_position').find('se-list-item').eq(2).shadow().find('elix-option').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_text_change_class', function () {
|
it('check tool_text_change_class', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
@@ -178,11 +180,11 @@ describe('use various parts of svg-edit', function () {
|
|||||||
it('check tool_text_delete', function () {
|
it('check tool_text_delete', function () {
|
||||||
cy.get('#svg_2_id').click({ force: true });
|
cy.get('#svg_2_id').click({ force: true });
|
||||||
cy.get('#tool_delete').click({ force: true });
|
cy.get('#tool_delete').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_text_change_font_family', function () {
|
it('check tool_text_change_font_family', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#tool_font_family').shadow().find('select').select("Serif");
|
cy.get('#tool_font_family').shadow().find('select').select("Serif");
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousedown')
|
.trigger('mousedown')
|
||||||
.trigger('mousemove', 20, 20, { force: true })
|
.trigger('mousemove', 20, 20, { force: true })
|
||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_image', function () {
|
it('check tool_image', function () {
|
||||||
cy.get('#tool_image').click({ force: true });
|
cy.get('#tool_image').click({ force: true });
|
||||||
@@ -50,6 +50,6 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.stub($win, 'prompt').returns('./images/logo.svg');
|
cy.stub($win, 'prompt').returns('./images/logo.svg');
|
||||||
cy.contains('OK');
|
cy.contains('OK');
|
||||||
});
|
});
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousedown', 150, 150, { force: true })
|
.trigger('mousedown', 150, 150, { force: true })
|
||||||
.trigger('mousemove', 250, 200, { force: true })
|
.trigger('mousemove', 250, 200, { force: true })
|
||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_fhellipse', function () {
|
it('check tool_fhellipse', function () {
|
||||||
cy.get('#tool_fhellipse')
|
cy.get('#tool_fhellipse')
|
||||||
@@ -42,7 +42,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousemove', 200, 180, { force: true })
|
.trigger('mousemove', 200, 180, { force: true })
|
||||||
.trigger('mousemove', 200, 80, { force: true })
|
.trigger('mousemove', 200, 80, { force: true })
|
||||||
.trigger('mouseup', 200, 80, { force: true });
|
.trigger('mouseup', 200, 80, { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_ellipse', function () {
|
it('check tool_ellipse', function () {
|
||||||
cy.get('#tool_ellipse').click({ force: true });
|
cy.get('#tool_ellipse').click({ force: true });
|
||||||
@@ -50,13 +50,13 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousedown', 75, 150, { force: true })
|
.trigger('mousedown', 75, 150, { force: true })
|
||||||
.trigger('mousemove', 130, 175, { force: true })
|
.trigger('mousemove', 130, 175, { force: true })
|
||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_circle_change_fill_color', function () {
|
it('check tool_circle_change_fill_color', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
cy.get('#js-se-palette').find('.square').eq(8)
|
cy.get('#js-se-palette').find('.square').eq(8)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_circle_change_opacity', function () {
|
it('check tool_circle_change_opacity', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
@@ -64,7 +64,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_ellipse_change_rotation', function () {
|
it('check tool_ellipse_change_rotation', function () {
|
||||||
cy.get('#svg_3').click({ force: true });
|
cy.get('#svg_3').click({ force: true });
|
||||||
@@ -72,7 +72,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_ellipse_change_blur', function () {
|
it('check tool_ellipse_change_blur', function () {
|
||||||
cy.get('#svg_3').click({ force: true });
|
cy.get('#svg_3').click({ force: true });
|
||||||
@@ -80,7 +80,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_ellipse_change_cx_cy_coordinate', function () {
|
it('check tool_ellipse_change_cx_cy_coordinate', function () {
|
||||||
cy.get('#svg_3').click({ force: true });
|
cy.get('#svg_3').click({ force: true });
|
||||||
@@ -92,7 +92,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#ellipse_cy').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#ellipse_cy').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_ellipse_change_rx_ry_radius', function () {
|
it('check tool_ellipse_change_rx_ry_radius', function () {
|
||||||
cy.get('#svg_3').click({ force: true });
|
cy.get('#svg_3').click({ force: true });
|
||||||
@@ -104,21 +104,21 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#ellipse_ry').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#ellipse_ry').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_ellipse_bring_to_back', function () {
|
it('check tool_ellipse_bring_to_back', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
cy.get('#tool_move_bottom').click({ force: true });
|
cy.get('#tool_move_bottom').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_ellipse_bring_to_front', function () {
|
it('check tool_ellipse_bring_to_front', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
cy.get('#tool_move_top').click({ force: true });
|
cy.get('#tool_move_top').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_ellipse_clone', function () {
|
it('check tool_ellipse_clone', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
cy.get('#tool_clone').click({ force: true });
|
cy.get('#tool_clone').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousemove', 0, 0, { force: true })
|
.trigger('mousemove', 0, 0, { force: true })
|
||||||
.trigger('mousedown', 0, 0, { force: true })
|
.trigger('mousedown', 0, 0, { force: true })
|
||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_path_change_node_xy', function () {
|
it('check tool_path_change_node_xy', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -51,7 +51,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#path_node_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#path_node_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_path_change_seg_type', function () {
|
it('check tool_path_change_seg_type', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -61,7 +61,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousedown', { force: true })
|
.trigger('mousedown', { force: true })
|
||||||
.trigger('mousemove', 130, 175, { force: true })
|
.trigger('mousemove', 130, 175, { force: true })
|
||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_path_change_clone_node', function () {
|
it('check tool_path_change_clone_node', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -71,14 +71,14 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousedown', { force: true })
|
.trigger('mousedown', { force: true })
|
||||||
.trigger('mousemove', 130, 175, { force: true })
|
.trigger('mousemove', 130, 175, { force: true })
|
||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_path_openclose', function () {
|
it('check tool_path_openclose', function () {
|
||||||
cy.get('#tool_select').click({ force: true });
|
cy.get('#tool_select').click({ force: true });
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#svg_1').dblclick({ force: true });
|
cy.get('#svg_1').dblclick({ force: true });
|
||||||
cy.get('#tool_openclose_path').click({ force: true });
|
cy.get('#tool_openclose_path').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
/* it('check tool_path_add_subpath', function () {
|
/* it('check tool_path_add_subpath', function () {
|
||||||
cy.get('#tool_add_subpath').click({ force: true });
|
cy.get('#tool_add_subpath').click({ force: true });
|
||||||
@@ -95,6 +95,6 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousedown', 0, 0, { force: true })
|
.trigger('mousedown', 0, 0, { force: true })
|
||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#tool_select').click({ force: true });
|
cy.get('#tool_select').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
}); */
|
}); */
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousedown', 150, 150, { force: true })
|
.trigger('mousedown', 150, 150, { force: true })
|
||||||
.trigger('mousemove', 250, 200, { force: true })
|
.trigger('mousemove', 250, 200, { force: true })
|
||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_fhrect', function () {
|
it('check tool_fhrect', function () {
|
||||||
cy.get('#tool_fhrect')
|
cy.get('#tool_fhrect')
|
||||||
@@ -42,7 +42,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousemove', 200, 180, { force: true })
|
.trigger('mousemove', 200, 180, { force: true })
|
||||||
.trigger('mousemove', 200, 80, { force: true })
|
.trigger('mousemove', 200, 80, { force: true })
|
||||||
.trigger('mouseup', 200, 80, { force: true });
|
.trigger('mouseup', 200, 80, { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_square', function () {
|
it('check tool_square', function () {
|
||||||
cy.get('#tool_square').click({ force: true });
|
cy.get('#tool_square').click({ force: true });
|
||||||
@@ -50,13 +50,13 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousedown', 75, 150, { force: true })
|
.trigger('mousedown', 75, 150, { force: true })
|
||||||
.trigger('mousemove', 125, 200, { force: true })
|
.trigger('mousemove', 125, 200, { force: true })
|
||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_rect_change_fill_color', function () {
|
it('check tool_rect_change_fill_color', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#js-se-palette').find('.square').eq(8)
|
cy.get('#js-se-palette').find('.square').eq(8)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_rect_change_rotation', function () {
|
it('check tool_rect_change_rotation', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -64,7 +64,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_rect_change_blur', function () {
|
it('check tool_rect_change_blur', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -72,7 +72,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_rect_change_opacity', function () {
|
it('check tool_rect_change_opacity', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -80,7 +80,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_fhrect_change_x_y_coordinate', function () {
|
it('check tool_fhrect_change_x_y_coordinate', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
@@ -92,7 +92,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#selected_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#selected_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_fhrect_change_width_height', function () {
|
it('check tool_fhrect_change_width_height', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
@@ -104,22 +104,22 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#rect_height').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#rect_height').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_square_clone', function () {
|
it('check tool_square_clone', function () {
|
||||||
cy.get('#svg_3').click({ force: true });
|
cy.get('#svg_3').click({ force: true });
|
||||||
cy.get('#tool_clone').click({ force: true });
|
cy.get('#tool_clone').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_square_bring_to_back', function () {
|
it('check tool_square_bring_to_back', function () {
|
||||||
cy.get('#svg_3').click({ force: true });
|
cy.get('#svg_3').click({ force: true });
|
||||||
cy.get('#tool_move_bottom').click({ force: true });
|
cy.get('#tool_move_bottom').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_square_bring_to_front', function () {
|
it('check tool_square_bring_to_front', function () {
|
||||||
cy.get('#svg_3').click({ force: true });
|
cy.get('#svg_3').click({ force: true });
|
||||||
cy.get('#tool_move_top').click({ force: true });
|
cy.get('#tool_move_top').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_square_change_corner_radius', function () {
|
it('check tool_square_change_corner_radius', function () {
|
||||||
cy.get('#svg_4').click({ force: true });
|
cy.get('#svg_4').click({ force: true });
|
||||||
@@ -127,19 +127,19 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#rect_rx').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#rect_rx').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_rect_change_to_path', function () {
|
it('check tool_rect_change_to_path', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
cy.get('#tool_topath').click({ force: true });
|
cy.get('#tool_topath').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_rect_delete', function () {
|
it('check tool_rect_delete', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#tool_delete').click({ force: true });
|
cy.get('#tool_delete').click({ force: true });
|
||||||
cy.get('#svg_3').click({ force: true });
|
cy.get('#svg_3').click({ force: true });
|
||||||
cy.get('#tool_delete').click({ force: true });
|
cy.get('#tool_delete').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_rect_change_class', function () {
|
it('check tool_rect_change_class', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mousedown', 200, 200, { force: true })
|
.trigger('mousedown', 200, 200, { force: true })
|
||||||
.trigger('mousemove', 250, 250, { force: true })
|
.trigger('mousemove', 250, 250, { force: true })
|
||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_line_change_class', function () {
|
it('check tool_line_change_class', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -59,7 +59,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_line_change_blur', function () {
|
it('check tool_line_change_blur', function () {
|
||||||
cy.get('#svg_1_id').click({ force: true });
|
cy.get('#svg_1_id').click({ force: true });
|
||||||
@@ -67,7 +67,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_line_change_opacity', function () {
|
it('check tool_line_change_opacity', function () {
|
||||||
cy.get('#svg_1_id').click({ force: true });
|
cy.get('#svg_1_id').click({ force: true });
|
||||||
@@ -75,12 +75,12 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_line_delete', function () {
|
it('check tool_line_delete', function () {
|
||||||
cy.get('#svg_1_id').click({ force: true });
|
cy.get('#svg_1_id').click({ force: true });
|
||||||
cy.get('#tool_delete').click({ force: true });
|
cy.get('#tool_delete').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_line_clone', function () {
|
it('check tool_line_clone', function () {
|
||||||
cy.get('#tool_line')
|
cy.get('#tool_line')
|
||||||
@@ -92,17 +92,17 @@ describe('use all parts of svg-edit', function () {
|
|||||||
.trigger('mouseup', { force: true });
|
.trigger('mouseup', { force: true });
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
cy.get('#tool_clone').click({ force: true });
|
cy.get('#tool_clone').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_line_bring_to_back', function () {
|
it('check tool_line_bring_to_back', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
cy.get('#tool_move_bottom').click({ force: true });
|
cy.get('#tool_move_bottom').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_line_bring_to_front', function () {
|
it('check tool_line_bring_to_front', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
cy.get('#tool_move_top').click({ force: true });
|
cy.get('#tool_move_top').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_line_change_x_y_coordinate', function () {
|
it('check tool_line_change_x_y_coordinate', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
@@ -122,7 +122,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#line_y2').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
cy.get('#line_y2').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_line_change_stroke_width', function () {
|
it('check tool_line_change_stroke_width', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
@@ -130,7 +130,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_line_change_stoke_color', function () {
|
it('check tool_line_change_stoke_color', function () {
|
||||||
cy.get('#svg_3').click({ force: true });
|
cy.get('#svg_3').click({ force: true });
|
||||||
@@ -141,13 +141,13 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#stroke_color').shadow().find('#color_picker').eq(0)
|
cy.get('#stroke_color').shadow().find('#color_picker').eq(0)
|
||||||
.find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0)
|
.find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0)
|
||||||
.find('#Ok').eq(0).click({ force: true });
|
.find('#Ok').eq(0).click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_line_align_to_page', function () {
|
it('check tool_line_align_to_page', function () {
|
||||||
cy.get('#svg_3').click({ force: true });
|
cy.get('#svg_3').click({ force: true });
|
||||||
cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened');
|
cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened');
|
||||||
cy.get('#tool_position').find('se-list-item').eq(2).shadow().find('elix-option').eq(0)
|
cy.get('#tool_position').find('se-list-item').eq(2).shadow().find('elix-option').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
it('check tool_polygon_clone', function () {
|
it('check tool_polygon_clone', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#tool_clone').click({ force: true });
|
cy.get('#tool_clone').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_polygon_change_class', function () {
|
it('check tool_polygon_change_class', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
@@ -63,7 +63,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_polygon_change_blur', function () {
|
it('check tool_polygon_change_blur', function () {
|
||||||
cy.get('#svg_2_id').click({ force: true });
|
cy.get('#svg_2_id').click({ force: true });
|
||||||
@@ -71,7 +71,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_polygon_change_opacity', function () {
|
it('check tool_polygon_change_opacity', function () {
|
||||||
cy.get('#svg_2_id').click({ force: true });
|
cy.get('#svg_2_id').click({ force: true });
|
||||||
@@ -79,29 +79,29 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_polygon_bring_to_back', function () {
|
it('check tool_polygon_bring_to_back', function () {
|
||||||
cy.get('#svg_2_id').click({ force: true });
|
cy.get('#svg_2_id').click({ force: true });
|
||||||
cy.get('#tool_move_bottom').click({ force: true });
|
cy.get('#tool_move_bottom').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_polygon_bring_to_front', function () {
|
it('check tool_polygon_bring_to_front', function () {
|
||||||
cy.get('#svg_2_id').click({ force: true });
|
cy.get('#svg_2_id').click({ force: true });
|
||||||
cy.get('#tool_move_top').click({ force: true });
|
cy.get('#tool_move_top').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_polygon_delete', function () {
|
it('check tool_polygon_delete', function () {
|
||||||
cy.get('#svg_2_id').click({ force: true });
|
cy.get('#svg_2_id').click({ force: true });
|
||||||
cy.get('#tool_delete').click({ force: true });
|
cy.get('#tool_delete').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_polygon_align_to_page', function () {
|
it('check tool_polygon_align_to_page', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened');
|
cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened');
|
||||||
cy.get('#tool_position').find('se-list-item').eq(0).shadow().find('elix-option').eq(0)
|
cy.get('#tool_position').find('se-list-item').eq(0).shadow().find('elix-option').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
/* it('check tool_polygon_change_x_y_coordinate', function () {
|
/* it('check tool_polygon_change_x_y_coordinate', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -113,7 +113,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#selected_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#selected_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
}); */
|
}); */
|
||||||
it('check tool_polygon_change_stroke_width', function () {
|
it('check tool_polygon_change_stroke_width', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -121,7 +121,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_polygon_change_stoke_fill_color', function () {
|
it('check tool_polygon_change_stoke_fill_color', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -139,12 +139,12 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#fill_color').shadow().find('#color_picker').eq(0)
|
cy.get('#fill_color').shadow().find('#color_picker').eq(0)
|
||||||
.find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0)
|
.find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0)
|
||||||
.find('#Ok').eq(0).click({ force: true });
|
.find('#Ok').eq(0).click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_polygon_change_sides', function () {
|
it('check tool_polygon_change_sides', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#polySides').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#polySides').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
it('check tool_star_clone', function () {
|
it('check tool_star_clone', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#tool_clone').click({ force: true });
|
cy.get('#tool_clone').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_star_change_class', function () {
|
it('check tool_star_change_class', function () {
|
||||||
cy.get('#svg_2').click({ force: true });
|
cy.get('#svg_2').click({ force: true });
|
||||||
@@ -63,7 +63,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_star_change_blur', function () {
|
it('check tool_star_change_blur', function () {
|
||||||
cy.get('#svg_2_id').click({ force: true });
|
cy.get('#svg_2_id').click({ force: true });
|
||||||
@@ -71,7 +71,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_star_change_opacity', function () {
|
it('check tool_star_change_opacity', function () {
|
||||||
cy.get('#svg_2_id').click({ force: true });
|
cy.get('#svg_2_id').click({ force: true });
|
||||||
@@ -79,29 +79,29 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_star_bring_to_back', function () {
|
it('check tool_star_bring_to_back', function () {
|
||||||
cy.get('#svg_2_id').click({ force: true });
|
cy.get('#svg_2_id').click({ force: true });
|
||||||
cy.get('#tool_move_bottom').click({ force: true });
|
cy.get('#tool_move_bottom').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_star_bring_to_front', function () {
|
it('check tool_star_bring_to_front', function () {
|
||||||
cy.get('#svg_2_id').click({ force: true });
|
cy.get('#svg_2_id').click({ force: true });
|
||||||
cy.get('#tool_move_top').click({ force: true });
|
cy.get('#tool_move_top').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_star_delete', function () {
|
it('check tool_star_delete', function () {
|
||||||
cy.get('#svg_2_id').click({ force: true });
|
cy.get('#svg_2_id').click({ force: true });
|
||||||
cy.get('#tool_delete').click({ force: true });
|
cy.get('#tool_delete').click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_star_align_to_page', function () {
|
it('check tool_star_align_to_page', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened');
|
cy.get('#tool_position').shadow().find('elix-dropdown-list').eq(0).invoke('attr', 'opened', 'opened');
|
||||||
cy.get('#tool_position').find('se-list-item').eq(0).shadow().find('elix-option').eq(0)
|
cy.get('#tool_position').find('se-list-item').eq(0).shadow().find('elix-option').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_star_change_stroke_width', function () {
|
it('check tool_star_change_stroke_width', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -109,7 +109,7 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#stroke_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
}
|
}
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_star_change_stoke_fill_color', function () {
|
it('check tool_star_change_stoke_fill_color', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
@@ -127,12 +127,12 @@ describe('use all parts of svg-edit', function () {
|
|||||||
cy.get('#fill_color').shadow().find('#color_picker').eq(0)
|
cy.get('#fill_color').shadow().find('#color_picker').eq(0)
|
||||||
.find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0)
|
.find('#jGraduate_colPick').eq(0).find('#jPicker-table').eq(0)
|
||||||
.find('#Ok').eq(0).click({ force: true });
|
.find('#Ok').eq(0).click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
it('check tool_star_change_sides', function () {
|
it('check tool_star_change_sides', function () {
|
||||||
cy.get('#svg_1').click({ force: true });
|
cy.get('#svg_1').click({ force: true });
|
||||||
cy.get('#starNumPoints').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
cy.get('#starNumPoints').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get('#svgcontent').toMatchSnapshot();
|
testSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
import { NS } from '../../../instrumented/svgcanvas/namespaces.js';
|
||||||
import * as utilities from '../../../instrumented/svgcanvas/utilities.js';
|
import * as utilities from '../../../instrumented/svgcanvas/utilities.js';
|
||||||
import * as hstory from '../../../instrumented/svgcanvas/history.js';
|
import * as history from '../../../instrumented/svgcanvas/history.js';
|
||||||
|
|
||||||
describe('history', function () {
|
describe('history', function () {
|
||||||
// TODO(codedread): Write tests for handling history events.
|
// TODO(codedread): Write tests for handling history events.
|
||||||
@@ -14,7 +14,7 @@ describe('history', function () {
|
|||||||
// const svg = document.createElementNS(NS.SVG, 'svg');
|
// const svg = document.createElementNS(NS.SVG, 'svg');
|
||||||
let undoMgr = null;
|
let undoMgr = null;
|
||||||
|
|
||||||
class MockCommand extends hstory.Command {
|
class MockCommand extends history.Command {
|
||||||
constructor (optText) {
|
constructor (optText) {
|
||||||
super();
|
super();
|
||||||
this.text = optText;
|
this.text = optText;
|
||||||
@@ -39,7 +39,7 @@ describe('history', function () {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
undoMgr = new hstory.UndoManager();
|
undoMgr = new history.UndoManager();
|
||||||
|
|
||||||
document.body.textContent = '';
|
document.body.textContent = '';
|
||||||
this.divparent = document.createElement('div');
|
this.divparent = document.createElement('div');
|
||||||
@@ -69,19 +69,19 @@ describe('history', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Test svgedit.history package', function () {
|
it('Test svgedit.history package', function () {
|
||||||
assert.ok(hstory);
|
assert.ok(history);
|
||||||
assert.ok(hstory.MoveElementCommand);
|
assert.ok(history.MoveElementCommand);
|
||||||
assert.ok(hstory.InsertElementCommand);
|
assert.ok(history.InsertElementCommand);
|
||||||
assert.ok(hstory.ChangeElementCommand);
|
assert.ok(history.ChangeElementCommand);
|
||||||
assert.ok(hstory.RemoveElementCommand);
|
assert.ok(history.RemoveElementCommand);
|
||||||
assert.ok(hstory.BatchCommand);
|
assert.ok(history.BatchCommand);
|
||||||
assert.ok(hstory.UndoManager);
|
assert.ok(history.UndoManager);
|
||||||
assert.equal(typeof hstory.MoveElementCommand, typeof function () { /* empty fn */ });
|
assert.equal(typeof history.MoveElementCommand, typeof function () { /* empty fn */ });
|
||||||
assert.equal(typeof hstory.InsertElementCommand, typeof function () { /* empty fn */ });
|
assert.equal(typeof history.InsertElementCommand, typeof function () { /* empty fn */ });
|
||||||
assert.equal(typeof hstory.ChangeElementCommand, typeof function () { /* empty fn */ });
|
assert.equal(typeof history.ChangeElementCommand, typeof function () { /* empty fn */ });
|
||||||
assert.equal(typeof hstory.RemoveElementCommand, typeof function () { /* empty fn */ });
|
assert.equal(typeof history.RemoveElementCommand, typeof function () { /* empty fn */ });
|
||||||
assert.equal(typeof hstory.BatchCommand, typeof function () { /* empty fn */ });
|
assert.equal(typeof history.BatchCommand, typeof function () { /* empty fn */ });
|
||||||
assert.equal(typeof hstory.UndoManager, typeof function () { /* empty fn */ });
|
assert.equal(typeof history.UndoManager, typeof function () { /* empty fn */ });
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Test UndoManager methods', function () {
|
it('Test UndoManager methods', function () {
|
||||||
@@ -275,7 +275,7 @@ describe('history', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Test MoveElementCommand', function () {
|
it('Test MoveElementCommand', function () {
|
||||||
let move = new hstory.MoveElementCommand(this.div3, this.div1, this.divparent);
|
let move = new history.MoveElementCommand(this.div3, this.div1, this.divparent);
|
||||||
assert.ok(move.unapply);
|
assert.ok(move.unapply);
|
||||||
assert.ok(move.apply);
|
assert.ok(move.apply);
|
||||||
assert.equal(typeof move.unapply, typeof function () { /* empty fn */ });
|
assert.equal(typeof move.unapply, typeof function () { /* empty fn */ });
|
||||||
@@ -291,7 +291,7 @@ describe('history', function () {
|
|||||||
assert.equal(this.divparent.firstElementChild.nextElementSibling, this.div2);
|
assert.equal(this.divparent.firstElementChild.nextElementSibling, this.div2);
|
||||||
assert.equal(this.divparent.lastElementChild, this.div3);
|
assert.equal(this.divparent.lastElementChild, this.div3);
|
||||||
|
|
||||||
move = new hstory.MoveElementCommand(this.div1, null, this.divparent);
|
move = new history.MoveElementCommand(this.div1, null, this.divparent);
|
||||||
|
|
||||||
move.unapply();
|
move.unapply();
|
||||||
assert.equal(this.divparent.firstElementChild, this.div2);
|
assert.equal(this.divparent.firstElementChild, this.div2);
|
||||||
@@ -303,7 +303,7 @@ describe('history', function () {
|
|||||||
assert.equal(this.divparent.firstElementChild.nextElementSibling, this.div2);
|
assert.equal(this.divparent.firstElementChild.nextElementSibling, this.div2);
|
||||||
assert.equal(this.divparent.lastElementChild, this.div3);
|
assert.equal(this.divparent.lastElementChild, this.div3);
|
||||||
|
|
||||||
move = new hstory.MoveElementCommand(this.div2, this.div5, this.div4);
|
move = new history.MoveElementCommand(this.div2, this.div5, this.div4);
|
||||||
|
|
||||||
move.unapply();
|
move.unapply();
|
||||||
assert.equal(this.divparent.firstElementChild, this.div1);
|
assert.equal(this.divparent.firstElementChild, this.div1);
|
||||||
@@ -321,7 +321,7 @@ describe('history', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Test InsertElementCommand', function () {
|
it('Test InsertElementCommand', function () {
|
||||||
let insert = new hstory.InsertElementCommand(this.div3);
|
let insert = new history.InsertElementCommand(this.div3);
|
||||||
assert.ok(insert.unapply);
|
assert.ok(insert.unapply);
|
||||||
assert.ok(insert.apply);
|
assert.ok(insert.apply);
|
||||||
assert.equal(typeof insert.unapply, typeof function () { /* empty fn */ });
|
assert.equal(typeof insert.unapply, typeof function () { /* empty fn */ });
|
||||||
@@ -339,7 +339,7 @@ describe('history', function () {
|
|||||||
assert.equal(this.div1.nextElementSibling, this.div2);
|
assert.equal(this.div1.nextElementSibling, this.div2);
|
||||||
assert.equal(this.div2.nextElementSibling, this.div3);
|
assert.equal(this.div2.nextElementSibling, this.div3);
|
||||||
|
|
||||||
insert = new hstory.InsertElementCommand(this.div2);
|
insert = new history.InsertElementCommand(this.div2);
|
||||||
|
|
||||||
insert.unapply();
|
insert.unapply();
|
||||||
assert.equal(this.divparent.childElementCount, 2);
|
assert.equal(this.divparent.childElementCount, 2);
|
||||||
@@ -358,7 +358,7 @@ describe('history', function () {
|
|||||||
const div6 = document.createElement('div');
|
const div6 = document.createElement('div');
|
||||||
div6.id = 'div6';
|
div6.id = 'div6';
|
||||||
|
|
||||||
let remove = new hstory.RemoveElementCommand(div6, null, this.divparent);
|
let remove = new history.RemoveElementCommand(div6, null, this.divparent);
|
||||||
assert.ok(remove.unapply);
|
assert.ok(remove.unapply);
|
||||||
assert.ok(remove.apply);
|
assert.ok(remove.apply);
|
||||||
assert.equal(typeof remove.unapply, typeof function () { /* empty fn */ });
|
assert.equal(typeof remove.unapply, typeof function () { /* empty fn */ });
|
||||||
@@ -377,7 +377,7 @@ describe('history', function () {
|
|||||||
assert.equal(this.div1.nextElementSibling, this.div2);
|
assert.equal(this.div1.nextElementSibling, this.div2);
|
||||||
assert.equal(this.div2.nextElementSibling, this.div3);
|
assert.equal(this.div2.nextElementSibling, this.div3);
|
||||||
|
|
||||||
remove = new hstory.RemoveElementCommand(div6, this.div2, this.divparent);
|
remove = new history.RemoveElementCommand(div6, this.div2, this.divparent);
|
||||||
|
|
||||||
remove.unapply();
|
remove.unapply();
|
||||||
assert.equal(this.divparent.childElementCount, 4);
|
assert.equal(this.divparent.childElementCount, 4);
|
||||||
@@ -395,7 +395,7 @@ describe('history', function () {
|
|||||||
|
|
||||||
it('Test ChangeElementCommand', function () {
|
it('Test ChangeElementCommand', function () {
|
||||||
this.div1.setAttribute('title', 'new title');
|
this.div1.setAttribute('title', 'new title');
|
||||||
let change = new hstory.ChangeElementCommand(this.div1,
|
let change = new history.ChangeElementCommand(this.div1,
|
||||||
{ title: 'old title', class: 'foo' });
|
{ title: 'old title', class: 'foo' });
|
||||||
assert.ok(change.unapply);
|
assert.ok(change.unapply);
|
||||||
assert.ok(change.apply);
|
assert.ok(change.apply);
|
||||||
@@ -411,7 +411,7 @@ describe('history', function () {
|
|||||||
assert.ok(!this.div1.getAttribute('class'));
|
assert.ok(!this.div1.getAttribute('class'));
|
||||||
|
|
||||||
this.div1.textContent = 'inner text';
|
this.div1.textContent = 'inner text';
|
||||||
change = new hstory.ChangeElementCommand(this.div1,
|
change = new history.ChangeElementCommand(this.div1,
|
||||||
{ '#text': null });
|
{ '#text': null });
|
||||||
|
|
||||||
change.unapply();
|
change.unapply();
|
||||||
@@ -421,7 +421,7 @@ describe('history', function () {
|
|||||||
assert.equal(this.div1.textContent, 'inner text');
|
assert.equal(this.div1.textContent, 'inner text');
|
||||||
|
|
||||||
this.div1.textContent = '';
|
this.div1.textContent = '';
|
||||||
change = new hstory.ChangeElementCommand(this.div1,
|
change = new history.ChangeElementCommand(this.div1,
|
||||||
{ '#text': 'old text' });
|
{ '#text': 'old text' });
|
||||||
|
|
||||||
change.unapply();
|
change.unapply();
|
||||||
@@ -450,7 +450,7 @@ describe('history', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gethrefvalue = '#newhref';
|
gethrefvalue = '#newhref';
|
||||||
change = new hstory.ChangeElementCommand(rect,
|
change = new history.ChangeElementCommand(rect,
|
||||||
{ '#href': '#oldhref' });
|
{ '#href': '#oldhref' });
|
||||||
assert.equal(justCalled, 'getHref');
|
assert.equal(justCalled, 'getHref');
|
||||||
|
|
||||||
@@ -466,7 +466,7 @@ describe('history', function () {
|
|||||||
|
|
||||||
const line = document.createElementNS(NS.SVG, 'line');
|
const line = document.createElementNS(NS.SVG, 'line');
|
||||||
line.setAttribute('class', 'newClass');
|
line.setAttribute('class', 'newClass');
|
||||||
change = new hstory.ChangeElementCommand(line, { class: 'oldClass' });
|
change = new history.ChangeElementCommand(line, { class: 'oldClass' });
|
||||||
|
|
||||||
assert.ok(change.unapply);
|
assert.ok(change.unapply);
|
||||||
assert.ok(change.apply);
|
assert.ok(change.apply);
|
||||||
@@ -484,7 +484,7 @@ describe('history', function () {
|
|||||||
let concatResult = '';
|
let concatResult = '';
|
||||||
MockCommand.prototype.apply = function () { concatResult += this.text; };
|
MockCommand.prototype.apply = function () { concatResult += this.text; };
|
||||||
|
|
||||||
const batch = new hstory.BatchCommand();
|
const batch = new history.BatchCommand();
|
||||||
assert.ok(batch.unapply);
|
assert.ok(batch.unapply);
|
||||||
assert.ok(batch.apply);
|
assert.ok(batch.apply);
|
||||||
assert.ok(batch.addSubCommand);
|
assert.ok(batch.addSubCommand);
|
||||||
|
|||||||
@@ -36,7 +36,8 @@ describe('select', function () {
|
|||||||
/**
|
/**
|
||||||
* @implements {module:select.SVGFactory}
|
* @implements {module:select.SVGFactory}
|
||||||
*/
|
*/
|
||||||
const mockFactory = {
|
const mockSvgCanvas = {
|
||||||
|
curConfig: mockConfig,
|
||||||
createSVGElement (jsonMap) {
|
createSVGElement (jsonMap) {
|
||||||
const elem = document.createElementNS(NS.SVG, jsonMap.element);
|
const elem = document.createElementNS(NS.SVG, jsonMap.element);
|
||||||
Object.entries(jsonMap.attr).forEach(([ attr, value ]) => {
|
Object.entries(jsonMap.attr).forEach(([ attr, value ]) => {
|
||||||
@@ -44,8 +45,8 @@ describe('select', function () {
|
|||||||
});
|
});
|
||||||
return elem;
|
return elem;
|
||||||
},
|
},
|
||||||
svgRoot () { return svgroot; },
|
getSvgRoot () { return svgroot; },
|
||||||
svgContent () { return svgContent; },
|
getSvgContent () { return svgContent; },
|
||||||
getDataStorage () { return dataStorage; }
|
getDataStorage () { return dataStorage; }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -54,18 +55,18 @@ describe('select', function () {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
svgroot = mockFactory.createSVGElement({
|
svgroot = mockSvgCanvas.createSVGElement({
|
||||||
element: 'svg',
|
element: 'svg',
|
||||||
attr: { id: 'svgroot' }
|
attr: { id: 'svgroot' }
|
||||||
});
|
});
|
||||||
svgContent = mockFactory.createSVGElement({
|
svgContent = mockSvgCanvas.createSVGElement({
|
||||||
element: 'svg',
|
element: 'svg',
|
||||||
attr: { id: 'svgcontent' }
|
attr: { id: 'svgcontent' }
|
||||||
});
|
});
|
||||||
|
|
||||||
svgroot.append(svgContent);
|
svgroot.append(svgContent);
|
||||||
/* const rect = */ svgContent.append(
|
/* const rect = */ svgContent.append(
|
||||||
mockFactory.createSVGElement({
|
mockSvgCanvas.createSVGElement({
|
||||||
element: 'rect',
|
element: 'rect',
|
||||||
attr: {
|
attr: {
|
||||||
id: 'rect',
|
id: 'rect',
|
||||||
@@ -117,7 +118,7 @@ describe('select', function () {
|
|||||||
assert.equal(svgroot.childNodes.item(0), svgContent);
|
assert.equal(svgroot.childNodes.item(0), svgContent);
|
||||||
assert.ok(!svgroot.querySelector('#selectorParentGroup'));
|
assert.ok(!svgroot.querySelector('#selectorParentGroup'));
|
||||||
|
|
||||||
select.init(mockConfig, mockFactory);
|
select.init(mockSvgCanvas);
|
||||||
|
|
||||||
assert.equal(svgroot.childNodes.length, 3);
|
assert.equal(svgroot.childNodes.length, 3);
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ describe('utilities bbox', function () {
|
|||||||
});
|
});
|
||||||
path.replacePathSeg(type, i, pts, pth);
|
path.replacePathSeg(type, i, pts, pth);
|
||||||
}
|
}
|
||||||
// path.reorientGrads(pth, m);
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -82,7 +81,18 @@ describe('utilities bbox', function () {
|
|||||||
});
|
});
|
||||||
sandbox.append(svgroot);
|
sandbox.append(svgroot);
|
||||||
|
|
||||||
path.init(null);
|
const mockSvgCanvas = {
|
||||||
|
createSVGElement (jsonMap) {
|
||||||
|
const elem = document.createElementNS(NS.SVG, jsonMap.element);
|
||||||
|
Object.entries(jsonMap.attr).forEach(([ attr, value ]) => {
|
||||||
|
elem.setAttribute(attr, value);
|
||||||
|
});
|
||||||
|
return elem;
|
||||||
|
},
|
||||||
|
getSvgRoot () { return svgroot; }
|
||||||
|
};
|
||||||
|
|
||||||
|
path.init(mockSvgCanvas);
|
||||||
mockaddSVGElemensFromJsonCallCount = 0;
|
mockaddSVGElemensFromJsonCallCount = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ describe('utilities performance', function () {
|
|||||||
// path.replacePathSeg(type, i, pts, path);
|
// path.replacePathSeg(type, i, pts, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// utilities.reorientGrads(path, m);
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,12 +25,12 @@ const loadExtensionTranslation = async function (svgEditor) {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name,
|
name,
|
||||||
async init(S) {
|
async init() {
|
||||||
const svgEditor = this;
|
const svgEditor = this;
|
||||||
await loadExtensionTranslation(svgEditor);
|
|
||||||
const { ChangeElementCommand } = S;
|
|
||||||
// svgdoc = S.svgroot.parentNode.ownerDocument,
|
|
||||||
const { svgCanvas } = svgEditor;
|
const { svgCanvas } = svgEditor;
|
||||||
|
await loadExtensionTranslation(svgEditor);
|
||||||
|
const { ChangeElementCommand } = svgCanvas.history;
|
||||||
|
// svgdoc = S.svgroot.parentNode.ownerDocument,
|
||||||
const addToHistory = function (cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); };
|
const addToHistory = function (cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); };
|
||||||
const currentStyle = {
|
const currentStyle = {
|
||||||
fillPaint: 'red', fillOpacity: 1.0,
|
fillPaint: 'red', fillOpacity: 1.0,
|
||||||
|
|||||||
@@ -29,9 +29,10 @@
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'markers',
|
name: 'markers',
|
||||||
async init (S) {
|
async init () {
|
||||||
const svgEditor = this;
|
const svgEditor = this;
|
||||||
const { svgCanvas } = svgEditor;
|
const { svgCanvas } = svgEditor;
|
||||||
|
const { BatchCommand, RemoveElementCommand, InsertElementCommand } = svgCanvas.history;
|
||||||
const { $id, addSVGElemensFromJson: addElem } = svgCanvas;
|
const { $id, addSVGElemensFromJson: addElem } = svgCanvas;
|
||||||
const mtypes = [ 'start', 'mid', 'end' ];
|
const mtypes = [ 'start', 'mid', 'end' ];
|
||||||
const markerElems = [ 'line', 'path', 'polyline', 'polygon' ];
|
const markerElems = [ 'line', 'path', 'polyline', 'polygon' ];
|
||||||
@@ -182,16 +183,16 @@ export default {
|
|||||||
if (m) { pline.setAttribute(nam, elem.getAttribute(nam)); }
|
if (m) { pline.setAttribute(nam, elem.getAttribute(nam)); }
|
||||||
});
|
});
|
||||||
|
|
||||||
const batchCmd = new S.BatchCommand();
|
const batchCmd = new BatchCommand();
|
||||||
batchCmd.addSubCommand(new S.RemoveElementCommand(elem, elem.parentNode));
|
batchCmd.addSubCommand(new RemoveElementCommand(elem, elem.parentNode));
|
||||||
batchCmd.addSubCommand(new S.InsertElementCommand(pline));
|
batchCmd.addSubCommand(new InsertElementCommand(pline));
|
||||||
|
|
||||||
elem.insertAdjacentElement('afterend', pline);
|
elem.insertAdjacentElement('afterend', pline);
|
||||||
elem.remove();
|
elem.remove();
|
||||||
svgCanvas.clearSelection();
|
svgCanvas.clearSelection();
|
||||||
pline.id = id;
|
pline.id = id;
|
||||||
svgCanvas.addToSelection([ pline ]);
|
svgCanvas.addToSelection([ pline ]);
|
||||||
S.addCommandToHistory(batchCmd);
|
svgCanvas.addCommandToHistory(batchCmd);
|
||||||
return pline;
|
return pline;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ const loadExtensionTranslation = async function (svgEditor) {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name,
|
name,
|
||||||
async init(_S) {
|
async init() {
|
||||||
const svgEditor = this;
|
const svgEditor = this;
|
||||||
const { ChangeElementCommand } = _S; // , svgcontent,
|
|
||||||
const addToHistory = function (cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); };
|
|
||||||
const { svgCanvas } = svgEditor;
|
const { svgCanvas } = svgEditor;
|
||||||
|
const { ChangeElementCommand } = svgCanvas.history;
|
||||||
|
const addToHistory = function (cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); };
|
||||||
const { $id } = svgCanvas;
|
const { $id } = svgCanvas;
|
||||||
let selElems;
|
let selElems;
|
||||||
let started;
|
let started;
|
||||||
|
|||||||
@@ -4,11 +4,6 @@
|
|||||||
* @license MIT
|
* @license MIT
|
||||||
* @copyright 2011 Jeff Schiller
|
* @copyright 2011 Jeff Schiller
|
||||||
*/
|
*/
|
||||||
import * as hstry from './history.js';
|
|
||||||
|
|
||||||
const {
|
|
||||||
InsertElementCommand, ChangeElementCommand, BatchCommand
|
|
||||||
} = hstry;
|
|
||||||
|
|
||||||
let svgCanvas = null;
|
let svgCanvas = null;
|
||||||
|
|
||||||
@@ -99,6 +94,10 @@ export const setBlurOffsets = function (filterElem, stdDev) {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const setBlur = function (val, complete) {
|
export const setBlur = function (val, complete) {
|
||||||
|
const {
|
||||||
|
InsertElementCommand, ChangeElementCommand, BatchCommand
|
||||||
|
} = svgCanvas.history;
|
||||||
|
|
||||||
const selectedElements = svgCanvas.getSelectedElements();
|
const selectedElements = svgCanvas.getSelectedElements();
|
||||||
if (svgCanvas.getCurCommand()) {
|
if (svgCanvas.getCurCommand()) {
|
||||||
finishChange();
|
finishChange();
|
||||||
@@ -147,7 +146,7 @@ export const setBlur = function (val, complete) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
svgCanvas.changeSelectedAttributeMethod('filter', 'url(#' + elemId + '_blur)');
|
svgCanvas.changeSelectedAttribute('filter', 'url(#' + elemId + '_blur)');
|
||||||
batchCmd.addSubCommand(new ChangeElementCommand(elem, changes));
|
batchCmd.addSubCommand(new ChangeElementCommand(elem, changes));
|
||||||
svgCanvas.setBlurOffsets(svgCanvas.getFilter(), val);
|
svgCanvas.setBlurOffsets(svgCanvas.getFilter(), val);
|
||||||
const filter = svgCanvas.getFilter();
|
const filter = svgCanvas.getFilter();
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ import {
|
|||||||
import {
|
import {
|
||||||
copyElem as utilCopyElem
|
copyElem as utilCopyElem
|
||||||
} from './copy-elem.js';
|
} from './copy-elem.js';
|
||||||
import {
|
|
||||||
BatchCommand, RemoveElementCommand, MoveElementCommand, ChangeElementCommand
|
|
||||||
} from './history.js';
|
|
||||||
import { getParentsUntil } from '../editor/components/jgraduate/Util.js';
|
import { getParentsUntil } from '../editor/components/jgraduate/Util.js';
|
||||||
|
|
||||||
const visElems = 'a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use'.split(',');
|
const visElems = 'a,circle,ellipse,foreignObject,g,image,line,path,polygon,polyline,rect,svg,text,tspan,use'.split(',');
|
||||||
@@ -817,6 +814,7 @@ export const cloneLayer = function (name, hrService) {
|
|||||||
* @returns {boolean} `true` if an old layer group was found to delete
|
* @returns {boolean} `true` if an old layer group was found to delete
|
||||||
*/
|
*/
|
||||||
export const deleteCurrentLayer = function () {
|
export const deleteCurrentLayer = function () {
|
||||||
|
const { BatchCommand, RemoveElementCommand } = svgCanvas.history;
|
||||||
let currentLayer = svgCanvas.getCurrentDrawing().getCurrentLayer();
|
let currentLayer = svgCanvas.getCurrentDrawing().getCurrentLayer();
|
||||||
const { nextSibling } = currentLayer;
|
const { nextSibling } = currentLayer;
|
||||||
const parent = currentLayer.parentNode;
|
const parent = currentLayer.parentNode;
|
||||||
@@ -880,6 +878,7 @@ export const renameCurrentLayer = function (newName) {
|
|||||||
* @returns {boolean} `true` if the current layer position was changed, `false` otherwise.
|
* @returns {boolean} `true` if the current layer position was changed, `false` otherwise.
|
||||||
*/
|
*/
|
||||||
export const setCurrentLayerPosition = function (newPos) {
|
export const setCurrentLayerPosition = function (newPos) {
|
||||||
|
const { MoveElementCommand } = svgCanvas.history;
|
||||||
const drawing = svgCanvas.getCurrentDrawing();
|
const drawing = svgCanvas.getCurrentDrawing();
|
||||||
const result = drawing.setCurrentLayerPosition(newPos);
|
const result = drawing.setCurrentLayerPosition(newPos);
|
||||||
if (result) {
|
if (result) {
|
||||||
@@ -898,6 +897,7 @@ export const setCurrentLayerPosition = function (newPos) {
|
|||||||
* @returns {boolean} true if the layer's visibility was set, false otherwise
|
* @returns {boolean} true if the layer's visibility was set, false otherwise
|
||||||
*/
|
*/
|
||||||
export const setLayerVisibility = function (layerName, bVisible) {
|
export const setLayerVisibility = function (layerName, bVisible) {
|
||||||
|
const { ChangeElementCommand } = svgCanvas.history;
|
||||||
const drawing = svgCanvas.getCurrentDrawing();
|
const drawing = svgCanvas.getCurrentDrawing();
|
||||||
const prevVisibility = drawing.getLayerVisibility(layerName);
|
const prevVisibility = drawing.getLayerVisibility(layerName);
|
||||||
const layer = drawing.setLayerVisibility(layerName, bVisible);
|
const layer = drawing.setLayerVisibility(layerName, bVisible);
|
||||||
@@ -924,6 +924,7 @@ export const setLayerVisibility = function (layerName, bVisible) {
|
|||||||
* @returns {boolean} Whether the selected elements were moved to the layer.
|
* @returns {boolean} Whether the selected elements were moved to the layer.
|
||||||
*/
|
*/
|
||||||
export const moveSelectedToLayer = function (layerName) {
|
export const moveSelectedToLayer = function (layerName) {
|
||||||
|
const { BatchCommand, MoveElementCommand } = svgCanvas.history;
|
||||||
// find the layer
|
// find the layer
|
||||||
const drawing = svgCanvas.getCurrentDrawing();
|
const drawing = svgCanvas.getCurrentDrawing();
|
||||||
const layer = drawing.getLayerByName(layerName);
|
const layer = drawing.getLayerByName(layerName);
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { jGraduate } from '../editor/components/jgraduate/jQuery.jGraduate.js';
|
import { jGraduate } from '../editor/components/jgraduate/jQuery.jGraduate.js';
|
||||||
import * as hstry from './history.js';
|
|
||||||
import { NS } from './namespaces.js';
|
import { NS } from './namespaces.js';
|
||||||
import {
|
import {
|
||||||
getVisibleElements, getStrokedBBoxDefaultVisible, findDefs,
|
getVisibleElements, getStrokedBBoxDefaultVisible, findDefs,
|
||||||
@@ -16,11 +15,6 @@ import {
|
|||||||
} from '../common/units.js';
|
} from '../common/units.js';
|
||||||
import { getParents } from '../editor/components/jgraduate/Util.js';
|
import { getParents } from '../editor/components/jgraduate/Util.js';
|
||||||
|
|
||||||
const {
|
|
||||||
InsertElementCommand, RemoveElementCommand,
|
|
||||||
ChangeElementCommand, BatchCommand
|
|
||||||
} = hstry;
|
|
||||||
|
|
||||||
let svgCanvas = null;
|
let svgCanvas = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,6 +75,10 @@ export const getTitleMethod = function (elem) {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const setGroupTitleMethod = function (val) {
|
export const setGroupTitleMethod = function (val) {
|
||||||
|
const {
|
||||||
|
InsertElementCommand, RemoveElementCommand,
|
||||||
|
ChangeElementCommand, BatchCommand
|
||||||
|
} = svgCanvas.history;
|
||||||
const selectedElements = svgCanvas.getSelectedElements();
|
const selectedElements = svgCanvas.getSelectedElements();
|
||||||
const dataStorage = svgCanvas.getDataStorage();
|
const dataStorage = svgCanvas.getDataStorage();
|
||||||
let elem = selectedElements[0];
|
let elem = selectedElements[0];
|
||||||
@@ -122,6 +120,7 @@ export const setGroupTitleMethod = function (val) {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const setDocumentTitleMethod = function (newTitle) {
|
export const setDocumentTitleMethod = function (newTitle) {
|
||||||
|
const { ChangeElementCommand, BatchCommand } = svgCanvas.history;
|
||||||
const childs = svgCanvas.getSvgContent().childNodes;
|
const childs = svgCanvas.getSvgContent().childNodes;
|
||||||
let docTitle = false; let oldTitle = '';
|
let docTitle = false; let oldTitle = '';
|
||||||
|
|
||||||
@@ -161,6 +160,7 @@ export const setDocumentTitleMethod = function (newTitle) {
|
|||||||
* It will fail on "fit to content" option with no content to fit to.
|
* It will fail on "fit to content" option with no content to fit to.
|
||||||
*/
|
*/
|
||||||
export const setResolutionMethod = function (x, y) {
|
export const setResolutionMethod = function (x, y) {
|
||||||
|
const { ChangeElementCommand, BatchCommand } = svgCanvas.history;
|
||||||
const zoom = svgCanvas.getZoom();
|
const zoom = svgCanvas.getZoom();
|
||||||
const res = svgCanvas.getResolution();
|
const res = svgCanvas.getResolution();
|
||||||
const { w, h } = res;
|
const { w, h } = res;
|
||||||
@@ -740,6 +740,7 @@ export const setTextContentMethod = function (val) {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const setImageURLMethod = function (val) {
|
export const setImageURLMethod = function (val) {
|
||||||
|
const { ChangeElementCommand, BatchCommand } = svgCanvas.history;
|
||||||
const selectedElements = svgCanvas.getSelectedElements();
|
const selectedElements = svgCanvas.getSelectedElements();
|
||||||
const elem = selectedElements[0];
|
const elem = selectedElements[0];
|
||||||
if (!elem) { return; }
|
if (!elem) { return; }
|
||||||
@@ -788,6 +789,7 @@ export const setImageURLMethod = function (val) {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const setLinkURLMethod = function (val) {
|
export const setLinkURLMethod = function (val) {
|
||||||
|
const { ChangeElementCommand, BatchCommand } = svgCanvas.history;
|
||||||
const selectedElements = svgCanvas.getSelectedElements();
|
const selectedElements = svgCanvas.getSelectedElements();
|
||||||
let elem = selectedElements[0];
|
let elem = selectedElements[0];
|
||||||
if (!elem) { return; }
|
if (!elem) { return; }
|
||||||
@@ -824,6 +826,7 @@ export const setLinkURLMethod = function (val) {
|
|||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const setRectRadiusMethod = function (val) {
|
export const setRectRadiusMethod = function (val) {
|
||||||
|
const { ChangeElementCommand } = svgCanvas.history;
|
||||||
const selectedElements = svgCanvas.getSelectedElements();
|
const selectedElements = svgCanvas.getSelectedElements();
|
||||||
const selected = selectedElements[0];
|
const selected = selectedElements[0];
|
||||||
if (!isNullish(selected) && selected.tagName === 'rect') {
|
if (!isNullish(selected) && selected.tagName === 'rect') {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ const uiStrings = {};
|
|||||||
* @param {module:path.uiStrings} strs
|
* @param {module:path.uiStrings} strs
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const setUiStrings = function (strs) {
|
export const setUiStrings = (strs) => {
|
||||||
Object.assign(uiStrings, strs.ui);
|
Object.assign(uiStrings, strs.ui);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ let pathData = {};
|
|||||||
* @param {boolean} lcp
|
* @param {boolean} lcp
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const setLinkControlPoints = function (lcp) {
|
export const setLinkControlPoints = (lcp) => {
|
||||||
linkControlPts = lcp;
|
linkControlPts = lcp;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -228,7 +228,7 @@ export let path = null;
|
|||||||
* @param {module:path.EditorContext} editorContext
|
* @param {module:path.EditorContext} editorContext
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const init = function (canvas) {
|
export const init = (canvas) => {
|
||||||
svgCanvas = canvas;
|
svgCanvas = canvas;
|
||||||
svgCanvas.replacePathSeg = replacePathSegMethod;
|
svgCanvas.replacePathSeg = replacePathSegMethod;
|
||||||
svgCanvas.addPointGrip = addPointGripMethod;
|
svgCanvas.addPointGrip = addPointGripMethod;
|
||||||
@@ -236,8 +236,10 @@ export const init = function (canvas) {
|
|||||||
svgCanvas.getPath_ = getPath_;
|
svgCanvas.getPath_ = getPath_;
|
||||||
svgCanvas.addCtrlGrip = addCtrlGripMethod;
|
svgCanvas.addCtrlGrip = addCtrlGripMethod;
|
||||||
svgCanvas.getCtrlLine = getCtrlLineMethod;
|
svgCanvas.getCtrlLine = getCtrlLineMethod;
|
||||||
|
svgCanvas.getGripPt = getGripPt;
|
||||||
svgCanvas.getPointFromGrip = getPointFromGripMethod;
|
svgCanvas.getPointFromGrip = getPointFromGripMethod;
|
||||||
svgCanvas.setLinkControlPoints = setLinkControlPoints;
|
svgCanvas.setLinkControlPoints = setLinkControlPoints;
|
||||||
|
svgCanvas.reorientGrads = reorientGrads;
|
||||||
svgCanvas.getSegData = () => { return segData; };
|
svgCanvas.getSegData = () => { return segData; };
|
||||||
svgCanvas.getUIStrings= () => { return uiStrings; };
|
svgCanvas.getUIStrings= () => { return uiStrings; };
|
||||||
svgCanvas.getPathObj = () => { return path; };
|
svgCanvas.getPathObj = () => { return path; };
|
||||||
@@ -249,7 +251,7 @@ export const init = function (canvas) {
|
|||||||
'Moveto', 'Lineto', 'CurvetoCubic', 'CurvetoQuadratic', 'Arc',
|
'Moveto', 'Lineto', 'CurvetoCubic', 'CurvetoQuadratic', 'Arc',
|
||||||
'LinetoHorizontal', 'LinetoVertical', 'CurvetoCubicSmooth', 'CurvetoQuadraticSmooth'
|
'LinetoHorizontal', 'LinetoVertical', 'CurvetoCubicSmooth', 'CurvetoQuadraticSmooth'
|
||||||
];
|
];
|
||||||
pathFuncsStrs.forEach(function(s){
|
pathFuncsStrs.forEach((s) => {
|
||||||
pathFuncs.push(s + 'Abs');
|
pathFuncs.push(s + 'Abs');
|
||||||
pathFuncs.push(s + 'Rel');
|
pathFuncs.push(s + 'Rel');
|
||||||
});
|
});
|
||||||
@@ -366,7 +368,7 @@ export const getSegSelector = getSegSelectorMethod;
|
|||||||
* @param {Point} pt - Object with x and y values (third point)
|
* @param {Point} pt - Object with x and y values (third point)
|
||||||
* @returns {Point[]} Array of two "smoothed" point objects
|
* @returns {Point[]} Array of two "smoothed" point objects
|
||||||
*/
|
*/
|
||||||
export const smoothControlPoints = function (ct1, ct2, pt) {
|
export const smoothControlPoints = (ct1, ct2, pt) => {
|
||||||
// each point must not be the origin
|
// each point must not be the origin
|
||||||
const x1 = ct1.x - pt.x;
|
const x1 = ct1.x - pt.x;
|
||||||
const y1 = ct1.y - pt.y;
|
const y1 = ct1.y - pt.y;
|
||||||
@@ -412,7 +414,7 @@ export const smoothControlPoints = function (ct1, ct2, pt) {
|
|||||||
* @param {SVGPathElement} elem
|
* @param {SVGPathElement} elem
|
||||||
* @returns {module:path.Path}
|
* @returns {module:path.Path}
|
||||||
*/
|
*/
|
||||||
export const getPath_ = function (elem) {
|
export const getPath_ = (elem) => {
|
||||||
let p = pathData[elem.id];
|
let p = pathData[elem.id];
|
||||||
if (!p) {
|
if (!p) {
|
||||||
p = pathData[elem.id] = new Path(elem);
|
p = pathData[elem.id] = new Path(elem);
|
||||||
@@ -425,13 +427,13 @@ export const getPath_ = function (elem) {
|
|||||||
* @param {string} id
|
* @param {string} id
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const removePath_ = function (id) {
|
export const removePath_ = (id) => {
|
||||||
if (id in pathData) { delete pathData[id]; }
|
if (id in pathData) { delete pathData[id]; }
|
||||||
};
|
};
|
||||||
|
|
||||||
let newcx; let newcy; let oldcx; let oldcy; let angle;
|
let newcx; let newcy; let oldcx; let oldcy; let angle;
|
||||||
|
|
||||||
const getRotVals = function (x, y) {
|
const getRotVals = (x, y) => {
|
||||||
let dx = x - oldcx;
|
let dx = x - oldcx;
|
||||||
let dy = y - oldcy;
|
let dy = y - oldcy;
|
||||||
|
|
||||||
@@ -466,7 +468,7 @@ const getRotVals = function (x, y) {
|
|||||||
* be optimized or even taken care of by `recalculateDimensions`
|
* be optimized or even taken care of by `recalculateDimensions`
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const recalcRotatedPath = function () {
|
export const recalcRotatedPath = () => {
|
||||||
const currentPath = path.elem;
|
const currentPath = path.elem;
|
||||||
angle = getRotationAngle(currentPath, true);
|
angle = getRotationAngle(currentPath, true);
|
||||||
if (!angle) { return; }
|
if (!angle) { return; }
|
||||||
@@ -524,7 +526,7 @@ export const recalcRotatedPath = function () {
|
|||||||
* @function module:path.clearData
|
* @function module:path.clearData
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const clearData = function () {
|
export const clearData = () => {
|
||||||
pathData = {};
|
pathData = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -535,7 +537,7 @@ export const clearData = function () {
|
|||||||
* @param {SVGMatrix} m
|
* @param {SVGMatrix} m
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
export const reorientGrads = function (elem, m) {
|
export const reorientGrads = (elem, m) => {
|
||||||
const bb = utilsGetBBox(elem);
|
const bb = utilsGetBBox(elem);
|
||||||
for (let i = 0; i < 2; i++) {
|
for (let i = 0; i < 2; i++) {
|
||||||
const type = i === 0 ? 'fill' : 'stroke';
|
const type = i === 0 ? 'fill' : 'stroke';
|
||||||
@@ -596,7 +598,7 @@ const pathMap = [
|
|||||||
* @param {boolean} toRel - true of convert to relative
|
* @param {boolean} toRel - true of convert to relative
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
export const convertPath = function (pth, toRel) {
|
export const convertPath = (pth, toRel) => {
|
||||||
const { pathSegList } = pth;
|
const { pathSegList } = pth;
|
||||||
const len = pathSegList.numberOfItems;
|
const len = pathSegList.numberOfItems;
|
||||||
let curx = 0; let cury = 0;
|
let curx = 0; let cury = 0;
|
||||||
@@ -760,8 +762,8 @@ export const convertPath = function (pth, toRel) {
|
|||||||
* @param {Integer[]} [lastPoint] - x,y point
|
* @param {Integer[]} [lastPoint] - x,y point
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
function pathDSegment (letter, points, morePoints, lastPoint) {
|
const pathDSegment = (letter, points, morePoints, lastPoint) => {
|
||||||
points.forEach(function(pnt, i){
|
points.forEach((pnt, i) => {
|
||||||
points[i] = shortFloat(pnt);
|
points[i] = shortFloat(pnt);
|
||||||
});
|
});
|
||||||
let segment = letter + points.join(' ');
|
let segment = letter + points.join(' ');
|
||||||
@@ -772,7 +774,7 @@ function pathDSegment (letter, points, morePoints, lastPoint) {
|
|||||||
segment += ' ' + shortFloat(lastPoint);
|
segment += ' ' + shortFloat(lastPoint);
|
||||||
}
|
}
|
||||||
return segment;
|
return segment;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Group: Path edit functions.
|
* Group: Path edit functions.
|
||||||
|
|||||||
@@ -363,7 +363,7 @@ export class SelectorManager {
|
|||||||
r: gripRadius,
|
r: gripRadius,
|
||||||
stroke: '#22C',
|
stroke: '#22C',
|
||||||
'stroke-width': 2,
|
'stroke-width': 2,
|
||||||
style: `cursor:url(${this.curConfig.imgPath}/rotate.svg) 12 12, auto;`
|
style: `cursor:url(${svgCanvas.curConfig.imgPath}/rotate.svg) 12 12, auto;`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.selectorGripsGroup.append(this.rotateGrip);
|
this.selectorGripsGroup.append(this.rotateGrip);
|
||||||
@@ -371,7 +371,7 @@ export class SelectorManager {
|
|||||||
|
|
||||||
if (document.getElementById('canvasBackground')) { return; }
|
if (document.getElementById('canvasBackground')) { return; }
|
||||||
|
|
||||||
const [ width, height ] = this.curConfig.dimensions;
|
const [ width, height ] = svgCanvas.curConfig.dimensions;
|
||||||
const canvasbg = svgCanvas.createSVGElement({
|
const canvasbg = svgCanvas.createSVGElement({
|
||||||
element: 'svg',
|
element: 'svg',
|
||||||
attr: {
|
attr: {
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ import { Canvg as canvg } from 'canvg';
|
|||||||
import 'pathseg'; // SVGPathSeg Polyfill (see https://github.com/progers/pathseg)
|
import 'pathseg'; // SVGPathSeg Polyfill (see https://github.com/progers/pathseg)
|
||||||
|
|
||||||
import * as pathModule from './path.js';
|
import * as pathModule from './path.js';
|
||||||
import * as hstry from './history.js';
|
import * as history from './history.js';
|
||||||
import * as draw from './draw.js';
|
import * as draw from './draw.js';
|
||||||
import {
|
import {
|
||||||
init as pasteInit, pasteElementsMethod
|
init as pasteInit, pasteElementsMethod
|
||||||
} from './paste-elem.js';
|
} from './paste-elem.js';
|
||||||
import { svgRootElement } from './svgroot.js';
|
import { svgRootElement } from './svgroot.js';
|
||||||
import {
|
import {
|
||||||
init as undoInit, getUndoManager, changeSelectedAttributeNoUndoMethod,
|
init as undoInit, changeSelectedAttributeNoUndoMethod,
|
||||||
changeSelectedAttributeMethod
|
changeSelectedAttributeMethod
|
||||||
} from './undo.js';
|
} from './undo.js';
|
||||||
import {
|
import {
|
||||||
@@ -806,7 +806,7 @@ class SvgCanvas {
|
|||||||
};
|
};
|
||||||
return convertToPath(
|
return convertToPath(
|
||||||
elem, attrs, this.addSVGElemensFromJson, this.pathActions,
|
elem, attrs, this.addSVGElemensFromJson, this.pathActions,
|
||||||
this.clearSelection, this.addToSelection, hstry, this.addCommandToHistory
|
this.clearSelection, this.addToSelection, history, this.addCommandToHistory
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -824,7 +824,6 @@ class SvgCanvas {
|
|||||||
this.addSVGElemensFromJson = addSVGElementsFromJson;
|
this.addSVGElemensFromJson = addSVGElementsFromJson;
|
||||||
this.clearSvgContentElement = clearSvgContentElementInit;
|
this.clearSvgContentElement = clearSvgContentElementInit;
|
||||||
this.textActions = textActionsMethod;
|
this.textActions = textActionsMethod;
|
||||||
this.undoMgr = getUndoManager();
|
|
||||||
this.getIntersectionList = getIntersectionListMethod;
|
this.getIntersectionList = getIntersectionListMethod;
|
||||||
this.getStrokedBBox = getStrokedBBoxDefaultVisible;
|
this.getStrokedBBox = getStrokedBBoxDefaultVisible;
|
||||||
this.getVisibleElements = getVisibleElements;
|
this.getVisibleElements = getVisibleElements;
|
||||||
@@ -936,6 +935,7 @@ class SvgCanvas {
|
|||||||
this.setBlur = setBlur; // Adds/updates the blur filter to the selected element.
|
this.setBlur = setBlur; // Adds/updates the blur filter to the selected element.
|
||||||
this.smoothControlPoints = pathModule.smoothControlPoints;
|
this.smoothControlPoints = pathModule.smoothControlPoints;
|
||||||
this.getTypeMap = getTypeMap;
|
this.getTypeMap = getTypeMap;
|
||||||
|
this.history = history; // object with all histor methods
|
||||||
this.NS = NS;
|
this.NS = NS;
|
||||||
this.$id = $id;
|
this.$id = $id;
|
||||||
this.$qq = $qq;
|
this.$qq = $qq;
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ let svgCanvas = null;
|
|||||||
*/
|
*/
|
||||||
export const init = function (canvas) {
|
export const init = function (canvas) {
|
||||||
svgCanvas = canvas;
|
svgCanvas = canvas;
|
||||||
|
canvas.undoMgr = getUndoManager();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getUndoManager = function () {
|
export const getUndoManager = () => {
|
||||||
return new UndoManager({
|
return new UndoManager({
|
||||||
/**
|
/**
|
||||||
* @param {string} eventType One of the HistoryEvent types
|
* @param {string} eventType One of the HistoryEvent types
|
||||||
|
|||||||
Reference in New Issue
Block a user