Merge pull request #626 from SVG-Edit/issues/623_1

master
JFH 2021-08-26 20:40:02 +02:00 committed by GitHub
commit b369f8f8ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1553 additions and 2 deletions

View File

@ -0,0 +1,953 @@
exports[`use all parts of svg-edit > check tool_source_set #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer"><title>Layer 1</title></g>
</svg>
`;
exports[`use all parts of svg-edit > check tool_rect #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
opacity="0.5"
style="pointer-events:inherit"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
>
<animate
attributeName="opacity"
begin="indefinite"
dur="0.2"
fill="freeze"
to="1"
></animate>
</rect>
</g>
</svg>
`;
exports[`use all parts of svg-edit > check tool_fhrect #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
opacity="0.5"
style="pointer-events:inherit"
x="350"
y="230"
width="120"
height="100"
id="svg_2"
>
<animate
attributeName="opacity"
begin="indefinite"
dur="0.2"
fill="freeze"
to="1"
></animate>
</rect>
</g>
</svg>
`;
exports[`use all parts of svg-edit > check tool_square #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="350"
y="230"
width="120"
height="100"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
opacity="0.5"
style="pointer-events:inherit"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
>
<animate
attributeName="opacity"
begin="indefinite"
dur="0.2"
fill="freeze"
to="1"
></animate>
</rect>
</g>
</svg>
`;
exports[`use all parts of svg-edit > check tool_rect_change_fill_color #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#ffff00"
stroke="#000000"
stroke-width="5"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="350"
y="230"
width="120"
height="100"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
</g>
</svg>
`;
exports[`use all parts of svg-edit > check tool_rect_change_rotation #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#ffff00"
stroke="#000000"
stroke-width="5"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
transform="rotate(25 200 175)"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="350"
y="230"
width="120"
height="100"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
</g>
</svg>
`;
exports[`use all parts of svg-edit > check tool_rect_change_blur #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#ffff00"
stroke="#000000"
stroke-width="5"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
transform="rotate(25 200 175)"
filter="url(#svg_1_blur)"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="350"
y="230"
width="120"
height="100"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
</g>
<defs>
<filter id="svg_1_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_rect_change_opacity #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#ffff00"
stroke="#000000"
stroke-width="5"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
filter="url(#svg_1_blur)"
opacity="0.5"
transform="rotate(25 200 175)"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="350"
y="230"
width="120"
height="100"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
</g>
<defs>
<filter id="svg_1_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_fhrect_change_x_y_coordinate #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#ffff00"
stroke="#000000"
stroke-width="5"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
filter="url(#svg_1_blur)"
opacity="0.5"
transform="rotate(25 200 175)"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="375"
y="255"
width="120"
height="100"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
</g>
<defs>
<filter id="svg_1_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_fhrect_change_width_height #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#ffff00"
stroke="#000000"
stroke-width="5"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
filter="url(#svg_1_blur)"
opacity="0.5"
transform="rotate(25 200 175)"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="375"
y="255"
width="145"
height="125"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
style="pointer-events:inherit"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
</g>
<defs>
<filter id="svg_1_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_square_clone #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#ffff00"
stroke="#000000"
stroke-width="5"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
filter="url(#svg_1_blur)"
opacity="0.5"
transform="rotate(25 200 175)"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="375"
y="255"
width="145"
height="125"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="245"
y="320"
width="50"
height="50"
fill-opacity="1"
stroke-opacity="1"
id="svg_4"
></rect>
</g>
<defs>
<filter id="svg_1_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_square_bring_to_back #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#ffff00"
stroke="#000000"
stroke-width="5"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
filter="url(#svg_1_blur)"
opacity="0.5"
transform="rotate(25 200 175)"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="375"
y="255"
width="145"
height="125"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="245"
y="320"
width="50"
height="50"
fill-opacity="1"
stroke-opacity="1"
id="svg_4"
></rect>
</g>
<defs>
<filter id="svg_1_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_square_bring_to_front #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#ffff00"
stroke="#000000"
stroke-width="5"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
filter="url(#svg_1_blur)"
opacity="0.5"
transform="rotate(25 200 175)"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="375"
y="255"
width="145"
height="125"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="245"
y="320"
width="50"
height="50"
fill-opacity="1"
stroke-opacity="1"
id="svg_4"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
</g>
<defs>
<filter id="svg_1_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_square_change_corner_radius #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#ffff00"
stroke="#000000"
stroke-width="5"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
filter="url(#svg_1_blur)"
opacity="0.5"
transform="rotate(25 200 175)"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="375"
y="255"
width="145"
height="125"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="245"
y="320"
width="50"
height="50"
fill-opacity="1"
stroke-opacity="1"
id="svg_4"
rx="25"
ry="25"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
</g>
<defs>
<filter id="svg_1_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_rect_change_to_path #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<rect
fill="#ffff00"
stroke="#000000"
stroke-width="5"
x="150"
y="150"
width="100"
height="50"
id="svg_1"
fill-opacity="1"
stroke-opacity="1"
filter="url(#svg_1_blur)"
opacity="0.5"
transform="rotate(25 200 175)"
></rect>
<path
fill="#FF0000"
stroke="#000000"
stroke-width="5"
opacity="0.5"
d="M375,255 L520,255 L520,380 L375,380 L375,255 Z"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></path>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="245"
y="320"
width="50"
height="50"
fill-opacity="1"
stroke-opacity="1"
id="svg_4"
rx="25"
ry="25"
></rect>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="225"
y="300"
width="50"
height="50"
id="svg_3"
fill-opacity="1"
stroke-opacity="1"
></rect>
</g>
<defs>
<filter id="svg_1_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_rect_delete #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<path
fill="#FF0000"
stroke="#000000"
stroke-width="5"
opacity="0.5"
d="M375,255 L520,255 L520,380 L375,380 L375,255 Z"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></path>
<rect
fill="#FF0000"
stroke="#000000"
stroke-width="5"
x="245"
y="320"
width="50"
height="50"
fill-opacity="1"
stroke-opacity="1"
id="svg_4"
rx="25"
ry="25"
></rect>
</g>
<defs>
<filter id="svg_1_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;

View File

@ -0,0 +1,312 @@
exports[`use all parts of svg-edit > check tool_source_set #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer"><title>Layer 1</title></g>
</svg>
`;
exports[`use all parts of svg-edit > check tool_line #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<line
fill="none"
stroke="#000000"
stroke-width="5"
opacity="0.5"
style="pointer-events:none"
x1="200"
y1="200"
x2="450"
y2="450"
id="svg_1"
>
<animate
attributeName="opacity"
begin="indefinite"
dur="0.2"
fill="freeze"
to="1"
></animate>
</line>
</g>
</svg>
`;
exports[`use all parts of svg-edit > check tool_line_change_rotation #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<line
fill="none"
stroke="#000000"
stroke-width="5"
x1="200"
y1="200"
x2="450"
y2="450"
id="svg_1_id"
fill-opacity="1"
stroke-opacity="1"
class="svg_1_class"
transform="rotate(25 325 325)"
></line>
</g>
</svg>
`;
exports[`use all parts of svg-edit > check tool_line_change_blur #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<line
fill="none"
stroke="#000000"
stroke-width="5"
x1="200"
y1="200"
x2="450"
y2="450"
id="svg_1_id"
fill-opacity="1"
stroke-opacity="1"
class="svg_1_class"
transform="rotate(25 325 325)"
filter="url(#svg_1_id_blur)"
></line>
</g>
<defs>
<filter id="svg_1_id_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_line_change_opacity #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<line
fill="none"
stroke="#000000"
stroke-width="5"
x1="200"
y1="200"
x2="450"
y2="450"
id="svg_1_id"
fill-opacity="1"
stroke-opacity="1"
class="svg_1_class"
filter="url(#svg_1_id_blur)"
opacity="0.5"
transform="rotate(25 325 325)"
></line>
</g>
<defs>
<filter id="svg_1_id_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_line_delete #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
</g>
<defs>
<filter id="svg_1_id_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_line_clone #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<line
fill="none"
stroke="#000000"
stroke-width="5"
opacity="0.25"
style="pointer-events:none"
x1="200"
y1="200"
x2="450"
y2="450"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
>
<animate
attributeName="opacity"
begin="indefinite"
dur="0.2"
fill="freeze"
to="0.5"
></animate>
</line>
<line
fill="none"
stroke="#000000"
stroke-width="5"
opacity="0.25"
style="pointer-events:none"
x1="220"
y1="220"
x2="470"
y2="470"
fill-opacity="1"
stroke-opacity="1"
id="svg_3"
>
<animate
attributeName="opacity"
begin="indefinite"
dur="0.2"
fill="freeze"
to="0.5"
id="svg_4"
></animate>
</line>
</g>
<defs>
<filter id="svg_1_id_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;
exports[`use all parts of svg-edit > check tool_fhrect_change_x_y_coordinate #0`] = `
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
width="640"
height="480"
id="svgcontent"
overflow="visible"
x="640"
y="480"
viewBox="0 0 640 480"
>
<g class="layer" style="pointer-events:all">
<title style="pointer-events:inherit">Layer 1</title>
<line
fill="none"
stroke="#000000"
stroke-width="5"
opacity="0.5"
x1="225"
y1="200"
x2="475"
y2="425"
id="svg_2"
fill-opacity="1"
stroke-opacity="1"
></line>
<line
fill="none"
stroke="#000000"
stroke-width="5"
opacity="0.25"
style="pointer-events:none"
x1="220"
y1="220"
x2="470"
y2="470"
fill-opacity="1"
stroke-opacity="1"
id="svg_3"
>
<animate
attributeName="opacity"
begin="indefinite"
dur="0.2"
fill="freeze"
to="0.5"
id="svg_4"
></animate>
</line>
</g>
<defs>
<filter id="svg_1_id_blur" x="-50%" y="-50%" width="200%" height="200%">
<feGaussianBlur in="SourceGraphic" stdDeviation="5"></feGaussianBlur>
</filter>
</defs>
</svg>
`;

View File

@ -0,0 +1,164 @@
import {
visitAndApproveStorage
} from '../../support/ui-test-helper.js';
const testSnapshot = () => {
cy.get('#svgcontent').cleanSnapshot();
};
describe('use all parts of svg-edit', function () {
before(() => {
visitAndApproveStorage();
});
it('check tool_source_set', function () {
cy.get('#tool_source').click({ force: true });
cy.get('#svg_source_textarea')
.type('{selectall}', { force: true })
.type(`<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<g class="layer">
<title>Layer 1</title>
</g>
</svg>`, { force: true, parseSpecialCharSequences: false });
cy.get('#tool_source_save').click({ force: true });
testSnapshot();
});
it('check tool_rect', function () {
cy.get('#tool_rect')
.click({ force: true });
cy.get('#svgcontent')
.trigger('mousedown', 150, 150, { force: true })
.trigger('mousemove', 250, 200, { force: true })
.trigger('mouseup', { force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_fhrect', function () {
cy.get('#tool_fhrect')
.click({ force: true });
cy.get('#svgcontent')
.trigger('mousedown', 200, 80, { force: true })
.trigger('mousemove', 320, 80, { force: true })
.trigger('mousemove', 320, 180, { force: true })
.trigger('mousemove', 200, 180, { force: true })
.trigger('mousemove', 200, 80, { force: true })
.trigger('mouseup', 200, 80, { force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_square', function () {
cy.get('#tool_square').click({ force: true });
cy.get('#svgcontent')
.trigger('mousedown', 75, 150, { force: true })
.trigger('mousemove', 125, 200, { force: true })
.trigger('mouseup', { force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_rect_change_fill_color', function () {
cy.get('#svg_1').click({ force: true });
cy.get('#js-se-palette').find('.square').eq(8)
.click({ force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_rect_change_rotation', function () {
cy.get('#svg_1').click({ force: true });
for(let n = 0; n < 5; n ++){
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
.click({ force: true });
}
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_rect_change_blur', function () {
cy.get('#svg_1').click({ force: true });
for(let n = 0; n < 10; n ++){
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
.click({ force: true });
}
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_rect_change_opacity', function () {
cy.get('#svg_1').click({ force: true });
for(let n = 0; n < 10; n ++){
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
.click({ force: true });
}
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_fhrect_change_x_y_coordinate', function () {
cy.get('#svg_2').click({ force: true });
for(let n = 0; n < 25; n ++){
cy.get('#selected_x').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
.click({ force: true });
}
for(let n = 0; n < 25; n ++){
cy.get('#selected_y').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
.click({ force: true });
}
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_fhrect_change_width_height', function () {
cy.get('#svg_2').click({ force: true });
for(let n = 0; n < 25; n ++){
cy.get('#rect_width').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
.click({ force: true });
}
for(let n = 0; n < 25; n ++){
cy.get('#rect_height').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
.click({ force: true });
}
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_square_clone', function () {
cy.get('#svg_3').click({ force: true });
cy.get('#tool_clone').click({ force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_square_bring_to_back', function () {
cy.get('#svg_3').click({ force: true });
cy.get('#tool_move_bottom').click({ force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_square_bring_to_front', function () {
cy.get('#svg_3').click({ force: true });
cy.get('#tool_move_top').click({ force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_square_change_corner_radius', function () {
cy.get('#svg_4').click({ force: true });
for(let n = 0; n < 25; n ++){
cy.get('#rect_rx').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
.click({ force: true });
}
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_rect_change_to_path', function () {
cy.get('#svg_2').click({ force: true });
cy.get('#tool_topath').click({ force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_rect_delete', function () {
cy.get('#svg_1').click({ force: true });
cy.get('#tool_delete').click({ force: true });
cy.get('#svg_3').click({ force: true });
cy.get('#tool_delete').click({ force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_rect_change_class', function () {
cy.get('#svg_2').click({ force: true });
cy.get('#elem_class').shadow().find('elix-input').eq(0).shadow().find('#inner').eq(0)
.type('svg_2_class{enter}', { force: true });
cy.get('#svg_2')
.should('satisfy', ($el) => {
const classList = Array.from($el[0].classList);
return classList.includes('svg_2_class');
});
});
it('check tool_rect_change_id', function () {
cy.get('#svg_2').click({ force: true }).click({ force: true });
cy.get('#elem_id').shadow().find('elix-input').eq(0).shadow().find('#inner').eq(0)
.type('_id{enter}', { force: true });
cy.get('#svg_2_id')
.should('satisfy', ($el) => {
const classList = Array.from($el[0].classList);
return classList.includes('svg_2_class');
});
});
});

View File

@ -0,0 +1,117 @@
import {
visitAndApproveStorage
} from '../../support/ui-test-helper.js';
const testSnapshot = () => {
cy.get('#svgcontent').cleanSnapshot();
};
describe('use all parts of svg-edit', function () {
before(() => {
visitAndApproveStorage();
});
it('check tool_source_set', function () {
cy.get('#tool_source').click({ force: true });
cy.get('#svg_source_textarea')
.type('{selectall}', { force: true })
.type(`<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
<g class="layer">
<title>Layer 1</title>
</g>
</svg>`, { force: true, parseSpecialCharSequences: false });
cy.get('#tool_source_save').click({ force: true });
testSnapshot();
});
it('check tool_line', function () {
cy.get('#tool_line')
.click({ force: true });
cy.get('#svgcontent')
.trigger('mousemove', 200, 200, { force: true })
.trigger('mousedown', 200, 200, { force: true })
.trigger('mousemove', 250, 250, { force: true })
.trigger('mouseup', { force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_line_change_class', function () {
cy.get('#svg_1').click({ force: true });
cy.get('#elem_class').shadow().find('elix-input').eq(0).shadow().find('#inner').eq(0)
.type('svg_1_class{enter}', { force: true });
cy.get('#svg_1')
.should('satisfy', ($el) => {
const classList = Array.from($el[0].classList);
return classList.includes('svg_1_class');
});
});
it('check tool_line_change_id', function () {
cy.get('#svg_1').click({ force: true }).click({ force: true });
cy.get('#elem_id').shadow().find('elix-input').eq(0).shadow().find('#inner').eq(0)
.type('_id{enter}', { force: true });
cy.get('#svg_1_id')
.should('satisfy', ($el) => {
const classList = Array.from($el[0].classList);
return classList.includes('svg_1_class');
});
});
it('check tool_line_change_rotation', function () {
cy.get('#svg_1_id').click({ force: true });
for(let n = 0; n < 5; n ++){
cy.get('#angle').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
.click({ force: true });
}
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_line_change_blur', function () {
cy.get('#svg_1_id').click({ force: true });
for(let n = 0; n < 10; n ++){
cy.get('#blur').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
.click({ force: true });
}
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_line_change_opacity', function () {
cy.get('#svg_1_id').click({ force: true });
for(let n = 0; n < 10; n ++){
cy.get('#opacity').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
.click({ force: true });
}
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_line_delete', function () {
cy.get('#svg_1_id').click({ force: true });
cy.get('#tool_delete').click({ force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_line_clone', function () {
cy.get('#tool_line')
.click({ force: true });
cy.get('#svgcontent')
.trigger('mousemove', 200, 200, { force: true })
.trigger('mousedown', 200, 200, { force: true })
.trigger('mousemove', 250, 250, { force: true })
.trigger('mouseup', { force: true });
cy.get('#svg_2').click({ force: true });
cy.get('#tool_clone').click({ force: true });
cy.get('#svgcontent').toMatchSnapshot();
});
it('check tool_fhrect_change_x_y_coordinate', function () {
cy.get('#svg_2').click({ force: true });
for(let n = 0; n < 25; n ++){
cy.get('#line_x1').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
.click({ force: true });
}
for(let n = 0; n < 25; n ++){
cy.get('#line_y1').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
.click({ force: true });
}
for(let n = 0; n < 25; n ++){
cy.get('#line_x2').shadow().find('elix-number-spin-box').eq(0).shadow().find('#upButton').eq(0)
.click({ force: true });
}
for(let n = 0; n < 25; n ++){
cy.get('#line_y2').shadow().find('elix-number-spin-box').eq(0).shadow().find('#downButton').eq(0)
.click({ force: true });
}
cy.get('#svgcontent').toMatchSnapshot();
});
});

View File

@ -154,11 +154,16 @@ export class SEInput extends HTMLElement {
* @returns {void}
*/
connectedCallback () {
this.addEventListener('change', (e) => {
this.$input.addEventListener('change', (e) => {
e.preventDefault();
this.value = e.target.value;
this.dispatchEvent(this.$event);
});
this.$input.addEventListener('keyup', (e) => {
e.preventDefault();
this.value = e.target.value;
this.dispatchEvent(this.$event);
});
this.dispatchEvent(this.$event);
}
}
// Register