Skip to content

Commit

Permalink
Do not set current pad in RCanvas drawings
Browse files Browse the repository at this point in the history
  • Loading branch information
linev committed Jun 21, 2024
1 parent ca76977 commit 05cf8fa
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions modules/gpad/RPadPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
});
}
Expand Down

0 comments on commit 05cf8fa

Please sign in to comment.