From 004bf8e8127b6611a591cd7dde0172745f4d136c Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 21 Jun 2022 16:35:19 +0200 Subject: [PATCH] Fixed LineAction and RectAction. --- modules/paint/actions/line_action.cpp | 4 ++++ modules/paint/actions/line_action.h | 1 + modules/paint/actions/rect_action.cpp | 4 ++++ modules/paint/actions/rect_action.h | 1 + 4 files changed, 10 insertions(+) diff --git a/modules/paint/actions/line_action.cpp b/modules/paint/actions/line_action.cpp index e90777fe9..25b9c8ccc 100644 --- a/modules/paint/actions/line_action.cpp +++ b/modules/paint/actions/line_action.cpp @@ -84,6 +84,10 @@ void LineAction::commit_action(PaintCanvas *canvas) { mouse_start_pos_set = false; } +bool LineAction::can_commit() { + return true; +} + LineAction::LineAction() { mouse_start_pos_set = false; } diff --git a/modules/paint/actions/line_action.h b/modules/paint/actions/line_action.h index 5a2347708..7bf80900a 100644 --- a/modules/paint/actions/line_action.h +++ b/modules/paint/actions/line_action.h @@ -35,6 +35,7 @@ class LineAction : public PaintAction { public: void do_action(PaintCanvas *canvas, const Array &data); void commit_action(PaintCanvas *canvas); + bool can_commit(); LineAction(); ~LineAction(); diff --git a/modules/paint/actions/rect_action.cpp b/modules/paint/actions/rect_action.cpp index 47cd515df..40ad6bdcd 100644 --- a/modules/paint/actions/rect_action.cpp +++ b/modules/paint/actions/rect_action.cpp @@ -91,6 +91,10 @@ void RectAction::commit_action(PaintCanvas *canvas) { mouse_start_pos_set = false; } +bool RectAction::can_commit() { + return true; +} + RectAction::RectAction() { mouse_start_pos_set = false; } diff --git a/modules/paint/actions/rect_action.h b/modules/paint/actions/rect_action.h index 89bb7411f..f8843b918 100644 --- a/modules/paint/actions/rect_action.h +++ b/modules/paint/actions/rect_action.h @@ -35,6 +35,7 @@ class RectAction : public PaintAction { public: void do_action(PaintCanvas *canvas, const Array &data); void commit_action(PaintCanvas *canvas); + bool can_commit(); RectAction(); ~RectAction();