Skip to content

Commit c18e77a

Browse files
committed
counter fix
1 parent 4b5112a commit c18e77a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/DrawingWidget.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,9 @@ void DrawingWidget::eventHandler(int source, int type, int id, QPointF pos, floa
444444
int ev_pen = penType;
445445
switch(type) {
446446
case PRESS:
447+
if (curs.drawing[id] && curs.drawing.contains(id)) {
448+
break;
449+
}
447450
num_of_press++;
448451
curs.drawing[id] = true;
449452
mergeSelection();
@@ -490,14 +493,15 @@ void DrawingWidget::eventHandler(int source, int type, int id, QPointF pos, floa
490493
penType = ev_pen;
491494
break;
492495
case RELEASE:
496+
if (!curs.drawing[id]) {
497+
break;
498+
}
493499
num_of_press--;
500+
curs.drawing[id] = false;
494501
if(curEventButtons & Qt::LeftButton && geo.size(id) < 2) {
495502
addPoint(-1, pos+QPointF(0,1));
496503
drawLineToFunc(id, pressure);
497504
}
498-
if (curs.drawing[id]) {
499-
curs.drawing[id] = false;
500-
}
501505
if(penMode == SELECTION) {
502506
addPoint(id, pos);
503507
createSelection();

0 commit comments

Comments
 (0)