mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-02-03 22:55:55 +01:00
Fix PasteCutAction.
This commit is contained in:
parent
118fd74a10
commit
6939e22983
@ -28,10 +28,12 @@ SOFTWARE.
|
|||||||
#include "../paint_canvas_layer.h"
|
#include "../paint_canvas_layer.h"
|
||||||
#include "../paint_utilities.h"
|
#include "../paint_utilities.h"
|
||||||
|
|
||||||
//data[2] = selection_pos
|
//arr.append(cell_mouse_position);
|
||||||
//data[3] = selection_color
|
//arr.append(last_cell_mouse_position);
|
||||||
//data[4] = cut pos
|
//arr.append(_selection_cells);
|
||||||
//data[5] = cut size
|
//arr.append(_selection_colors);
|
||||||
|
//arr.append(_cut_pos);
|
||||||
|
//arr.append(_cut_size);
|
||||||
void PasteCutAction::do_action(PaintCanvas *canvas, const Array &data) {
|
void PasteCutAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||||
PaintAction::do_action(canvas, 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 -= cut_pos + cut_size / 2;
|
||||||
pixel += pixel_pos;
|
pixel += pixel_pos;
|
||||||
|
|
||||||
if (canvas->validate_pixel_v(pixel)) {
|
if (!canvas->validate_pixel_v(pixel)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,9 +28,9 @@ SOFTWARE.
|
|||||||
#include "scene/gui/control.h"
|
#include "scene/gui/control.h"
|
||||||
|
|
||||||
#include "bush_prefabs.h"
|
#include "bush_prefabs.h"
|
||||||
|
#include "core/hash_map.h"
|
||||||
#include "core/os/keyboard.h"
|
#include "core/os/keyboard.h"
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
#include "core/hash_map.h"
|
|
||||||
|
|
||||||
class PaintAction;
|
class PaintAction;
|
||||||
class PaintCanvasLayer;
|
class PaintCanvasLayer;
|
||||||
@ -232,8 +232,8 @@ public:
|
|||||||
PoolVector2iArray _selection_cells;
|
PoolVector2iArray _selection_cells;
|
||||||
PoolColorArray _selection_colors;
|
PoolColorArray _selection_colors;
|
||||||
|
|
||||||
Vector2 _cut_pos;
|
Vector2i _cut_pos;
|
||||||
Vector2 _cut_size;
|
Vector2i _cut_size;
|
||||||
|
|
||||||
Vector<Ref<PaintAction>> _actions_history;
|
Vector<Ref<PaintAction>> _actions_history;
|
||||||
Vector<Ref<PaintAction>> _redo_history;
|
Vector<Ref<PaintAction>> _redo_history;
|
||||||
|
Loading…
Reference in New Issue
Block a user