diff --git a/modules/gpad/RPadPainter.mjs b/modules/gpad/RPadPainter.mjs index 58064cf5a..c6a8eb31a 100644 --- a/modules/gpad/RPadPainter.mjs +++ b/modules/gpad/RPadPainter.mjs @@ -1047,12 +1047,8 @@ class RPadPainter extends RObjectPainter { if (snap.fPrimitives && snap.fPrimitives.length > 0) padpainter.addPadButtons(); - // we select current pad, where all drawing is performed - const prev_name = padpainter.selectCurrentPad(padpainter.this_pad_name); - return padpainter.drawNextSnap(snap.fPrimitives).then(() => { padpainter.addPadInteractive(); - padpainter.selectCurrentPad(prev_name); return this.drawNextSnap(lst, indx); }); } @@ -1234,12 +1230,8 @@ class RPadPainter extends RObjectPainter { this.addPadButtons(true); } - const prev_name = this.selectCurrentPad(this.this_pad_name); - return this.drawNextSnap(snap.fPrimitives).then(() => { this.addPadInteractive(); - this.selectCurrentPad(prev_name); - if (getActivePad() === this) this.getCanvPainter()?.producePadEvent('padredraw', this); return this; @@ -1635,17 +1627,12 @@ class RPadPainter extends RObjectPainter { if (painter.matchObjectType(clTPad) && (!painter.has_canvas || painter.hasObjectsToDraw())) painter.addPadButtons(); - // we select current pad, where all drawing is performed - const prev_name = painter.has_canvas ? painter.selectCurrentPad(painter.this_pad_name) : undefined; - selectActivePad({ pp: painter, active: false }); // flag used to prevent immediate pad redraw during first draw return painter.drawPrimitives().then(() => { painter.addPadInteractive(); painter.showPadButtons(); - // we restore previous pad name - painter.selectCurrentPad(prev_name); return painter; }); }