Skip to content

Commit e57f798

Browse files
committed
Do not activate pad with TButton
1 parent 29f7b46 commit e57f798

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/gpad/TCanvasPainter.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -621,12 +621,12 @@ class TCanvasPainter extends TPadPainter {
621621
selectActivePad(pad_painter, obj_painter, click_pos) {
622622
if (!this.snapid || !pad_painter) return; // only interactive canvas
623623

624-
let arg = null, ischanged = false;
624+
let arg = null, ischanged = false, is_button = pad_painter.matchObjectType('TButton');
625625

626626
if (pad_painter.snapid && this._websocket)
627627
arg = { _typename: 'TWebPadClick', padid: pad_painter.snapid.toString(), objid: '', x: -1, y: -1, dbl: false };
628628

629-
if (!pad_painter.is_active_pad) {
629+
if (!pad_painter.is_active_pad && !is_button) {
630630
ischanged = true;
631631
this.forEachPainterInPad(pp => pp.drawActiveBorder(null, pp === pad_painter), 'pads');
632632
}
@@ -643,7 +643,7 @@ class TCanvasPainter extends TPadPainter {
643643
if (click_pos.dbl) arg.dbl = true;
644644
}
645645

646-
if (arg && ischanged)
646+
if (arg && (ischanged || is_button))
647647
this.sendWebsocket('PADCLICKED:' + toJSON(arg));
648648
}
649649

0 commit comments

Comments
 (0)