Skip to content

Commit

Permalink
Fix - no extra layout for webcanvas json drawn from hpainter
Browse files Browse the repository at this point in the history
  • Loading branch information
linev committed Nov 22, 2024
1 parent 2db5654 commit 13930c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/gpad/RPadPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/gpad/TPadPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 13930c2

Please sign in to comment.