diff --git a/badges/coverage-badge.svg b/badges/coverage-badge.svg index d7f457d4..eeec4ddc 100644 --- a/badges/coverage-badge.svg +++ b/badges/coverage-badge.svg @@ -1 +1 @@ -Statements 51.23%Statements 51.23%Branches 40.96%Branches 40.96%Lines 51.97%Lines 51.97%Functions 58.29%Functions 58.29% +Statements 51.1%Statements 51.1%Branches 40.83%Branches 40.83%Lines 51.81%Lines 51.81%Functions 58.62%Functions 58.62% diff --git a/cypress/integration/ui/__snapshots__/scenario.js.snap b/cypress/integration/ui/__snapshots__/scenario.js.snap index 3636cb70..e86c99c6 100644 --- a/cypress/integration/ui/__snapshots__/scenario.js.snap +++ b/cypress/integration/ui/__snapshots__/scenario.js.snap @@ -221,7 +221,6 @@ exports[`use various parts of svg-edit > check tool_italic #0`] = ` fill-opacity="1" stroke-opacity="1" id="svg_2" - transform="matrix(1 0 0 1 0 0)" > B @@ -286,7 +285,6 @@ exports[`use various parts of svg-edit > check tool_bold #0`] = ` fill-opacity="1" stroke-opacity="1" id="svg_2" - transform="matrix(1 0 0 1 0 0)" > B @@ -351,7 +349,6 @@ exports[`use various parts of svg-edit > check change color #0`] = ` fill-opacity="1" stroke-opacity="1" id="svg_2" - transform="matrix(1 0 0 1 0 0)" > B @@ -417,7 +414,6 @@ exports[`use various parts of svg-edit > check tool_start #0`] = ` fill-opacity="1" stroke-opacity="1" id="svg_2" - transform="matrix(1 0 0 1 0 0)" > B @@ -449,203 +445,3 @@ exports[`use various parts of svg-edit > check tool_start #0`] = ` `; - -exports[`use various parts of svg-edit > check tool_star #0`] = ` - - - Layer 1 - - - B - - - B - - - - - - -`; - -exports[`use various parts of svg-edit > check tool_polygon #0`] = ` - - - Layer 1 - - - B - - - B - - - - - - - -`; diff --git a/dist/editor/images/tool_add_subpath.svg b/dist/editor/images/tool_add_subpath.svg new file mode 100644 index 00000000..49bd5fe5 --- /dev/null +++ b/dist/editor/images/tool_add_subpath.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/editor/images/tool_node_clone.svg b/dist/editor/images/tool_node_clone.svg new file mode 100644 index 00000000..c414e4de --- /dev/null +++ b/dist/editor/images/tool_node_clone.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/dist/editor/images/tool_node_delete.svg b/dist/editor/images/tool_node_delete.svg new file mode 100644 index 00000000..4dab4630 --- /dev/null +++ b/dist/editor/images/tool_node_delete.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/dist/editor/images/tool_openclose_path.svg b/dist/editor/images/tool_openclose_path.svg new file mode 100644 index 00000000..7fb68745 --- /dev/null +++ b/dist/editor/images/tool_openclose_path.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/editor/index.html b/dist/editor/index.html index a2ca81d2..f50354d4 100644 --- a/dist/editor/index.html +++ b/dist/editor/index.html @@ -374,10 +374,10 @@ -
-
-
-
+ + + +
diff --git a/dist/editor/system/images/tool_add_subpath.svg b/dist/editor/system/images/tool_add_subpath.svg new file mode 100644 index 00000000..49bd5fe5 --- /dev/null +++ b/dist/editor/system/images/tool_add_subpath.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/editor/system/images/tool_node_clone.svg b/dist/editor/system/images/tool_node_clone.svg new file mode 100644 index 00000000..c414e4de --- /dev/null +++ b/dist/editor/system/images/tool_node_clone.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/dist/editor/system/images/tool_node_delete.svg b/dist/editor/system/images/tool_node_delete.svg new file mode 100644 index 00000000..4dab4630 --- /dev/null +++ b/dist/editor/system/images/tool_node_delete.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/dist/editor/system/images/tool_openclose_path.svg b/dist/editor/system/images/tool_openclose_path.svg new file mode 100644 index 00000000..7fb68745 --- /dev/null +++ b/dist/editor/system/images/tool_openclose_path.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/editor/system/index.html b/dist/editor/system/index.html index 8c78c58e..9d3af1e8 100644 --- a/dist/editor/system/index.html +++ b/dist/editor/system/index.html @@ -381,10 +381,10 @@ -
-
-
-
+ + + +
diff --git a/dist/editor/xdomain-index.html b/dist/editor/xdomain-index.html index 3293a022..b95648d9 100644 --- a/dist/editor/xdomain-index.html +++ b/dist/editor/xdomain-index.html @@ -374,10 +374,10 @@ -
-
-
-
+ + + +
diff --git a/src/editor/images/tool_add_subpath.svg b/src/editor/images/tool_add_subpath.svg new file mode 100644 index 00000000..49bd5fe5 --- /dev/null +++ b/src/editor/images/tool_add_subpath.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/editor/images/tool_node_clone.svg b/src/editor/images/tool_node_clone.svg new file mode 100644 index 00000000..c414e4de --- /dev/null +++ b/src/editor/images/tool_node_clone.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/editor/images/tool_node_delete.svg b/src/editor/images/tool_node_delete.svg new file mode 100644 index 00000000..4dab4630 --- /dev/null +++ b/src/editor/images/tool_node_delete.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/src/editor/images/tool_openclose_path.svg b/src/editor/images/tool_openclose_path.svg new file mode 100644 index 00000000..7fb68745 --- /dev/null +++ b/src/editor/images/tool_openclose_path.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/editor/index.html b/src/editor/index.html index a2ca81d2..f50354d4 100644 --- a/src/editor/index.html +++ b/src/editor/index.html @@ -374,10 +374,10 @@ -
-
-
-
+ + + +
diff --git a/src/editor/svgedit.js b/src/editor/svgedit.js index d7aaced7..fb44cb62 100644 --- a/src/editor/svgedit.js +++ b/src/editor/svgedit.js @@ -1303,8 +1303,8 @@ editor.init = () => { * @returns {void} */ const togglePathEditMode = function (editmode, elems) { - // $('#path_node_panel').toggle(editmode); - // $('#tools_bottom_2,#tools_bottom_3').toggle(!editmode); + $('#path_node_panel').toggle(editmode); + $('#tools_bottom_2,#tools_bottom_3').toggle(!editmode); if (editmode) { // Change select icon $('.tool_button_current').removeClass('tool_button_current').addClass('tool_button'); @@ -1978,7 +1978,7 @@ editor.init = () => { $('#tool_reorient').toggleClass('disabled', angle === 0); } else { const point = path.getNodePoint(); - $('#tool_add_subpath').removeClass('push_button_pressed').addClass('tool_button'); + $('#tool_add_subpath').pressed = false; $('#tool_node_delete').toggleClass('disabled', !path.canDeleteNodes); // Show open/close button based on selected point @@ -2056,9 +2056,9 @@ editor.init = () => { if (tagName === 'text') { $('#text_panel').css('display', 'inline'); - $('#tool_font_size').css('display', 'inline'); - $id('tool_italic').pressed = (svgCanvas.getItalic()) ? true : false; - $id('tool_bold').pressed = (svgCanvas.getBold()) ? true : false; + $('#tool_font_size').css('display', 'inline'); + $id('tool_italic').pressed = svgCanvas.getItalic(); + $id('tool_bold').pressed = svgCanvas.getBold(); $('#font_family').val(elem.getAttribute('font-family')); $('#font_size').val(elem.getAttribute('font-size')); $('#text').val(elem.textContent); @@ -3716,8 +3716,9 @@ editor.init = () => { */ const addSubPath = function () { const button = $('#tool_add_subpath'); - const sp = !button.hasClass('push_button_pressed'); - button.toggleClass('push_button_pressed tool_button'); + const sp = !button.hasClass('pressed'); + button.pressed = sp; + // button.toggleClass('push_button_pressed tool_button'); path.addSubPath(sp); }; @@ -4872,6 +4873,10 @@ editor.init = () => { $id('tool_align_top').addEventListener('click', () => clickAlign('top')); $id('tool_align_bottom').addEventListener('click', () => clickAlign('bottom')); $id('tool_align_middle').addEventListener('click', () => clickAlign('middle')); + $id('tool_node_clone').addEventListener('click', clonePathNode); + $id('tool_node_delete').addEventListener('click', deletePathNode); + $id('tool_openclose_path').addEventListener('click', opencloseSubPath); + $id('tool_add_subpath').addEventListener('click', addSubPath); // register actions for left panel $id('tool_select').addEventListener('click', clickSelect); @@ -4934,10 +4939,6 @@ editor.init = () => { {sel: '#tool_open', fn () { window.dispatchEvent(new CustomEvent('openImage')); }, evt: 'click'}, {sel: '#tool_import', fn () { window.dispatchEvent(new CustomEvent('importImage')); }, evt: 'click'}, {sel: '#tool_node_link', fn: linkControlPoints, evt: 'click'}, - {sel: '#tool_node_clone', fn: clonePathNode, evt: 'click'}, - {sel: '#tool_node_delete', fn: deletePathNode, evt: 'click'}, - {sel: '#tool_openclose_path', fn: opencloseSubPath, evt: 'click'}, - {sel: '#tool_add_subpath', fn: addSubPath, evt: 'click'}, {sel: '#tool_ungroup', fn: clickGroup, evt: 'click'}, {sel: '#tool_unlink_use', fn: clickGroup, evt: 'click'}, {sel: '#sidepanel_handle', fn: toggleSidePanel, key: ['X']},