Skip to content

Commit ba9c63c

Browse files
committed
check selection on clear button
1 parent 88c61d1 commit ba9c63c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Selection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void MovableWidget::mouseReleaseEvent(QMouseEvent *event) {
4343
(void)event;
4444
}
4545

46-
static bool hasSelection = false;
46+
bool hasSelection = false;
4747

4848
void DrawingWidget::createSelection() {
4949
hasSelection = true;

src/SetupWidgets.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ extern WhiteBoard *board;
3636
extern QMainWindow* mainWindow;
3737

3838
extern bool fuarMode;
39-
39+
extern bool hasSelection;
4040
QPushButton *selectButton;
4141

4242
QPushButton *penButton;
@@ -967,7 +967,7 @@ static void setupClear(){
967967
clearButtonLayout->addWidget(yesButton);
968968

969969
QPushButton *clear = create_button(":images/clear.svg", [=](){
970-
if(drawing->penMode == SELECTION) {
970+
if(drawing->penMode == SELECTION && hasSelection) {
971971
drawing->clearSelection();
972972
return;
973973
}

0 commit comments

Comments
 (0)