Browse Source

Prevent comments from being processed when selected in the layers tree.

pull/5719/head
Brian Ernesto 2 years ago
parent
commit
e3caf50329
  1. 4
      src/commands/view/ShowOffset.ts
  2. 3
      src/utils/dom.ts

4
src/commands/view/ShowOffset.ts

@ -18,6 +18,10 @@ export default {
const zoom = this.em.getZoomDecimal();
const el = opt.el as HTMLElement | undefined;
// if (!(el instanceof HTMLElement)) {
// return;
// }
if (!config.showOffsets || !el || isTextNode(el) || (!config.showOffsetsSelected && state == 'Fixed')) {
editor.stopCommand(`${this.id}`, opts);
return;

3
src/utils/dom.ts

@ -37,6 +37,9 @@ export const attrUp = (el?: HTMLElement, attrs: ObjectAny = {}) =>
el && el.setAttribute && each(attrs, (value, key) => el.setAttribute(key, value));
export const isVisible = (el?: HTMLElement) => {
if (!el || !(el instanceof HTMLElement)) {
return false;
}
return el && !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);
};

Loading…
Cancel
Save