Skip to content

Commit

Permalink
fixed copy/paste shapes of General section #1025 #1015
Browse files Browse the repository at this point in the history
  • Loading branch information
unocelli committed Dec 23, 2023
1 parent edc55e5 commit af0b356
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/src/app/_helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ export class Utils {

static lineColor = ['#4484ef', '#ef0909', '#00b050', '#ffd04a', '#7030a0', '#a5a5a5', '#c0504d', '#000000'];

static svgTagToType = ['rect', 'line', 'path', 'circle', 'ellipse', 'text'];

static searchTreeStartWith(element, matchingStart) {
if (element.id.startsWith(matchingStart)) {
return element;
Expand Down Expand Up @@ -85,6 +87,9 @@ export class Utils {

static getInTreeIdAndType(element: Element): any[] {
let type = element.getAttribute('type');
if (!type && Utils.svgTagToType.includes(element.tagName.toLowerCase())) {
type = 'svg-ext-shapes-' + element.tagName.toLowerCase();
}
let id = element.getAttribute('id');
let result = [];
if (id && type) {
Expand Down

0 comments on commit af0b356

Please sign in to comment.