From 13930c285e2d0b84cf308885686927b7e1eb1b20 Mon Sep 17 00:00:00 2001 From: Sergey Linev Date: Fri, 22 Nov 2024 09:30:59 +0100 Subject: [PATCH] Fix - no extra layout for webcanvas json drawn from hpainter --- modules/gpad/RPadPainter.mjs | 4 ++-- modules/gpad/TPadPainter.mjs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/gpad/RPadPainter.mjs b/modules/gpad/RPadPainter.mjs index f87f0cb13..b140a69a9 100644 --- a/modules/gpad/RPadPainter.mjs +++ b/modules/gpad/RPadPainter.mjs @@ -5,7 +5,7 @@ import { RObjectPainter } from '../base/RObjectPainter.mjs'; import { prSVG, getElementRect, getAbsPosInCanvas, DrawOptions, compressSVG, makeTranslate, svgToImage } from '../base/BasePainter.mjs'; import { selectActivePad, getActivePad } from '../base/ObjectPainter.mjs'; import { registerForResize, saveFile } from '../gui/utils.mjs'; -import { BrowserLayout } from '../gui/display.mjs'; +import { BrowserLayout, getHPainter } from '../gui/display.mjs'; import { createMenu, closeMenu } from '../gui/menu.mjs'; import { PadButtonsHandler } from './TPadPainter.mjs'; @@ -1183,7 +1183,7 @@ class RPadPainter extends RObjectPainter { const mainid = this.selectDom().attr('id'); - if (!this.isBatchMode() && !this.use_openui && !this.brlayout && mainid && isStr(mainid)) { + if (!this.isBatchMode() && !this.use_openui && !this.brlayout && mainid && isStr(mainid) && !getHPainter()) { this.brlayout = new BrowserLayout(mainid, null, this); this.brlayout.create(mainid, true); this.setDom(this.brlayout.drawing_divid()); // need to create canvas diff --git a/modules/gpad/TPadPainter.mjs b/modules/gpad/TPadPainter.mjs index d7ce379b5..07dc3d60a 100644 --- a/modules/gpad/TPadPainter.mjs +++ b/modules/gpad/TPadPainter.mjs @@ -1879,7 +1879,7 @@ class TPadPainter extends ObjectPainter { const mainid = this.selectDom().attr('id'); - if (!this.isBatchMode() && !this.use_openui && !this.brlayout && mainid && isStr(mainid)) { + if (!this.isBatchMode() && !this.use_openui && !this.brlayout && mainid && isStr(mainid) && !getHPainter()) { this.brlayout = new BrowserLayout(mainid, null, this); this.brlayout.create(mainid, true); this.setDom(this.brlayout.drawing_divid()); // need to create canvas