File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,12 @@ void DrawingWidget::mouseMoveEvent(QMouseEvent *event) {
359359 penType = penTypeBak;
360360}
361361
362+ void DrawingWidget::addImage (QImage img){
363+ images.last_image_num ++;
364+ images.image_count = images.last_image_num ;
365+ images.saveValue (images.last_image_num , img.copy ());
366+ }
367+
362368void DrawingWidget::mouseReleaseEvent (QMouseEvent *event) {
363369 if (curEventButtons & Qt::LeftButton && !isMoved) {
364370 drawLineTo (event->position ()+QPointF (0 ,1 ));
@@ -371,11 +377,10 @@ void DrawingWidget::mouseReleaseEvent(QMouseEvent *event) {
371377 update ();
372378 return ;
373379 }
374- images.last_image_num ++;
375- images.image_count = images.last_image_num ;
376- images.saveValue (images.last_image_num , image.copy ());
380+
377381 curEventButtons = 0 ;
378382 curs.hide (-1 );
383+ addImage (image);
379384}
380385
381386void DrawingWidget::initializeImage (const QSize &size) {
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ class DrawingWidget : public QWidget {
6464 bool isNextAvailable ();
6565 void loadImage (int num);
6666 void mergeSelection ();
67+ void addImage (QImage img);
6768
6869protected:
6970 bool drawing = false ;
Original file line number Diff line number Diff line change @@ -59,5 +59,6 @@ void DrawingWidget::mergeSelection() {
5959 cropWidget->move (QPoint (-1 ,-1 ));
6060 update ();
6161 painter.end ();
62+ addImage (image);
6263
6364}
You can’t perform that action at this time.
0 commit comments