Fix PasteCutAction.

This commit is contained in:
Relintai 2022-06-21 20:26:05 +02:00
parent 118fd74a10
commit 6939e22983
2 changed files with 10 additions and 8 deletions

View File

@ -28,10 +28,12 @@ SOFTWARE.
#include "../paint_canvas_layer.h"
#include "../paint_utilities.h"
//data[2] = selection_pos
//data[3] = selection_color
//data[4] = cut pos
//data[5] = cut size
//arr.append(cell_mouse_position);
//arr.append(last_cell_mouse_position);
//arr.append(_selection_cells);
//arr.append(_selection_colors);
//arr.append(_cut_pos);
//arr.append(_cut_size);
void PasteCutAction::do_action(PaintCanvas *canvas, const Array &data) {
PaintAction::do_action(canvas, data);
@ -51,7 +53,7 @@ void PasteCutAction::do_action(PaintCanvas *canvas, const Array &data) {
pixel -= cut_pos + cut_size / 2;
pixel += pixel_pos;
if (canvas->validate_pixel_v(pixel)) {
if (!canvas->validate_pixel_v(pixel)) {
continue;
}

View File

@ -28,9 +28,9 @@ SOFTWARE.
#include "scene/gui/control.h"
#include "bush_prefabs.h"
#include "core/hash_map.h"
#include "core/os/keyboard.h"
#include "core/reference.h"
#include "core/hash_map.h"
class PaintAction;
class PaintCanvasLayer;
@ -232,8 +232,8 @@ public:
PoolVector2iArray _selection_cells;
PoolColorArray _selection_colors;
Vector2 _cut_pos;
Vector2 _cut_size;
Vector2i _cut_pos;
Vector2i _cut_size;
Vector<Ref<PaintAction>> _actions_history;
Vector<Ref<PaintAction>> _redo_history;