mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-08 11:59:39 +01:00
Const qualifiers and references for the paint module.
This commit is contained in:
parent
d98f9746e8
commit
25d219a4a0
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "brighten_action.h"
|
||||
|
||||
void BrightenAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void BrightenAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
/*
|
||||
.do_action(canvas, data)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class BrightenAction : public PaintAction {
|
||||
GDCLASS(BrightenAction, PaintAction);
|
||||
|
||||
public:
|
||||
void do_action(PaintCanvas *canvas, Array data);
|
||||
void do_action(PaintCanvas *canvas, const Array &data);
|
||||
void commit_action(PaintCanvas *canvas);
|
||||
|
||||
void undo_action(PaintCanvas *canvas);
|
||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "brush_action.h"
|
||||
|
||||
void BrushAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void BrushAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
/*
|
||||
.do_action(canvas, data)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class BrushAction : public PaintAction {
|
||||
GDCLASS(BrushAction, PaintAction);
|
||||
|
||||
public:
|
||||
void do_action(PaintCanvas *canvas, Array data);
|
||||
void do_action(PaintCanvas *canvas, const Array &data);
|
||||
void commit_action(PaintCanvas *canvas);
|
||||
|
||||
void undo_action(PaintCanvas *canvas);
|
||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "bucket_action.h"
|
||||
|
||||
void BucketAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void BucketAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
/*
|
||||
.do_action(canvas, data)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class BucketAction : public PaintAction {
|
||||
GDCLASS(BucketAction, PaintAction);
|
||||
|
||||
public:
|
||||
void do_action(PaintCanvas *canvas, Array data);
|
||||
void do_action(PaintCanvas *canvas, const Array &data);
|
||||
void commit_action(PaintCanvas *canvas);
|
||||
|
||||
void undo_action(PaintCanvas *canvas);
|
||||
|
@ -28,7 +28,7 @@ bool CutAction::can_commit() {
|
||||
return false; //ugly way of handling a cut
|
||||
}
|
||||
|
||||
void CutAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void CutAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
/*
|
||||
.do_action(canvas, data)
|
||||
|
||||
|
@ -35,7 +35,7 @@ class CutAction : public PaintAction {
|
||||
public:
|
||||
bool can_commit();
|
||||
|
||||
void do_action(PaintCanvas *canvas, Array data);
|
||||
void do_action(PaintCanvas *canvas, const Array &data);
|
||||
void commit_action(PaintCanvas *canvas);
|
||||
|
||||
void undo_action(PaintCanvas *canvas);
|
||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "darken_action.h"
|
||||
|
||||
void DarkenAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void DarkenAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
/*
|
||||
.do_action(canvas, data)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class DarkenAction : public PaintAction {
|
||||
GDCLASS(DarkenAction, PaintAction);
|
||||
|
||||
public:
|
||||
void do_action(PaintCanvas *canvas, Array data);
|
||||
void do_action(PaintCanvas *canvas, const Array &data);
|
||||
void commit_action(PaintCanvas *canvas);
|
||||
|
||||
void undo_action(PaintCanvas *canvas);
|
||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "line_action.h"
|
||||
|
||||
void LineAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void LineAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
/*
|
||||
.do_action(canvas, data)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class LineAction : public PaintAction {
|
||||
GDCLASS(LineAction, PaintAction);
|
||||
|
||||
public:
|
||||
void do_action(PaintCanvas *canvas, Array data);
|
||||
void do_action(PaintCanvas *canvas, const Array &data);
|
||||
void commit_action(PaintCanvas *canvas);
|
||||
|
||||
void undo_action(PaintCanvas *canvas);
|
||||
|
@ -28,7 +28,7 @@ bool MultiLineAction::can_commit() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void MultiLineAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void MultiLineAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
/*
|
||||
.do_action(canvas, data)
|
||||
|
||||
|
@ -35,7 +35,7 @@ class MultiLineAction : public PaintAction {
|
||||
public:
|
||||
bool can_commit();
|
||||
|
||||
void do_action(PaintCanvas *canvas, Array data);
|
||||
void do_action(PaintCanvas *canvas, const Array &data);
|
||||
void commit_action(PaintCanvas *canvas);
|
||||
|
||||
void undo_action(PaintCanvas *canvas);
|
||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "paint_action.h"
|
||||
|
||||
void PaintAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void PaintAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
if (!action_data_redo.has("cells")) {
|
||||
action_data_redo["cells"] = Array();
|
||||
action_data_redo["colors"] = Array();
|
||||
@ -58,7 +58,7 @@ bool PaintAction::can_commit() {
|
||||
return !action_data_redo.empty();
|
||||
}
|
||||
|
||||
PoolVector2iArray PaintAction::get_x_sym_points(int canvas_width, Vector2i pixel) {
|
||||
PoolVector2iArray PaintAction::get_x_sym_points(const int canvas_width, const Vector2i &pixel) {
|
||||
int p = canvas_width - pixel.x;
|
||||
|
||||
PoolVector2iArray points;
|
||||
@ -67,7 +67,7 @@ PoolVector2iArray PaintAction::get_x_sym_points(int canvas_width, Vector2i pixel
|
||||
|
||||
return points;
|
||||
}
|
||||
PoolVector2iArray PaintAction::get_y_sym_points(int canvas_height, Vector2i pixel) {
|
||||
PoolVector2iArray PaintAction::get_y_sym_points(const int canvas_height, const Vector2i &pixel) {
|
||||
int p = canvas_height - pixel.y;
|
||||
|
||||
PoolVector2iArray points;
|
||||
@ -76,7 +76,7 @@ PoolVector2iArray PaintAction::get_y_sym_points(int canvas_height, Vector2i pixe
|
||||
|
||||
return points;
|
||||
}
|
||||
PoolVector2iArray PaintAction::get_xy_sym_points(int canvas_width, int canvas_height, Vector2i pixel) {
|
||||
PoolVector2iArray PaintAction::get_xy_sym_points(const int canvas_width, const int canvas_height, const Vector2i &pixel) {
|
||||
PoolVector2iArray all_points;
|
||||
PoolVector2iArray xpoints = get_x_sym_points(canvas_width, pixel);
|
||||
|
||||
@ -102,7 +102,7 @@ PoolVector2iArray PaintAction::get_xy_sym_points(int canvas_width, int canvas_he
|
||||
|
||||
return points;
|
||||
}
|
||||
PoolVector2iArray PaintAction::get_points(PaintCanvas *canvas, Vector2i pixel) {
|
||||
PoolVector2iArray PaintAction::get_points(PaintCanvas *canvas, const Vector2i &pixel) {
|
||||
/*
|
||||
PoolVector2iArray points;
|
||||
if canvas.symmetry_x and canvas.symmetry_y:
|
||||
|
@ -41,17 +41,17 @@ class PaintAction : public Reference {
|
||||
GDCLASS(PaintAction, Reference);
|
||||
|
||||
public:
|
||||
virtual void do_action(PaintCanvas *canvas, Array data);
|
||||
virtual void do_action(PaintCanvas *canvas, const Array &data);
|
||||
virtual void commit_action(PaintCanvas *canvas);
|
||||
|
||||
virtual void undo_action(PaintCanvas *canvas);
|
||||
virtual void redo_action(PaintCanvas *canvas);
|
||||
virtual bool can_commit();
|
||||
|
||||
virtual PoolVector2iArray get_x_sym_points(int canvas_width, Vector2i pixel);
|
||||
virtual PoolVector2iArray get_y_sym_points(int canvas_height, Vector2i pixel);
|
||||
virtual PoolVector2iArray get_xy_sym_points(int canvas_width, int canvas_height, Vector2i pixel);
|
||||
virtual PoolVector2iArray get_points(PaintCanvas *canvas, Vector2i pixel);
|
||||
virtual PoolVector2iArray get_x_sym_points(const int canvas_width, const Vector2i &pixel);
|
||||
virtual PoolVector2iArray get_y_sym_points(const int canvas_height, const Vector2i &pixel);
|
||||
virtual PoolVector2iArray get_xy_sym_points(const int canvas_width, const int canvas_height, const Vector2i &pixel);
|
||||
virtual PoolVector2iArray get_points(PaintCanvas *canvas, const Vector2i &pixel);
|
||||
|
||||
PaintAction();
|
||||
~PaintAction();
|
||||
|
@ -28,7 +28,7 @@ SOFTWARE.
|
||||
//data[3] = selection_color
|
||||
//data[4] = cut pos
|
||||
//data[5] = cut size
|
||||
void PasteCutAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void PasteCutAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
/*
|
||||
.do_action(canvas, data)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class PasteCutAction : public PaintAction {
|
||||
GDCLASS(PasteCutAction, PaintAction);
|
||||
|
||||
public:
|
||||
void do_action(PaintCanvas *canvas, Array data);
|
||||
void do_action(PaintCanvas *canvas, const Array &data);
|
||||
void commit_action(PaintCanvas *canvas);
|
||||
|
||||
void undo_action(PaintCanvas *canvas);
|
||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "pencil_action.h"
|
||||
|
||||
void PencilAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void PencilAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
/*
|
||||
.do_action(canvas, data)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class PencilAction : public PaintAction {
|
||||
GDCLASS(PencilAction, PaintAction);
|
||||
|
||||
public:
|
||||
void do_action(PaintCanvas *canvas, Array data);
|
||||
void do_action(PaintCanvas *canvas, const Array &data);
|
||||
void commit_action(PaintCanvas *canvas);
|
||||
|
||||
void undo_action(PaintCanvas *canvas);
|
||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "rainbow_action.h"
|
||||
|
||||
void RainbowAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void RainbowAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
/*
|
||||
.do_action(canvas, data)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class RainbowAction : public PaintAction {
|
||||
GDCLASS(RainbowAction, PaintAction);
|
||||
|
||||
public:
|
||||
void do_action(PaintCanvas *canvas, Array data);
|
||||
void do_action(PaintCanvas *canvas, const Array &data);
|
||||
void commit_action(PaintCanvas *canvas);
|
||||
|
||||
void undo_action(PaintCanvas *canvas);
|
||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "rect_action.h"
|
||||
|
||||
void RectAction::do_action(PaintCanvas *canvas, Array data) {
|
||||
void RectAction::do_action(PaintCanvas *canvas, const Array &data) {
|
||||
/*
|
||||
.do_action(canvas, data)
|
||||
|
||||
|
@ -33,7 +33,7 @@ class RectAction : public PaintAction {
|
||||
GDCLASS(RectAction, PaintAction);
|
||||
|
||||
public:
|
||||
void do_action(PaintCanvas *canvas, Array data);
|
||||
void do_action(PaintCanvas *canvas, const Array &data);
|
||||
void commit_action(PaintCanvas *canvas);
|
||||
|
||||
void undo_action(PaintCanvas *canvas);
|
||||
|
@ -44,7 +44,7 @@ const list = [
|
||||
]
|
||||
*/
|
||||
|
||||
PoolVector3iArray BrushPrefabs::get_brush(BrushPrefabs::Type type, int size) {
|
||||
PoolVector3iArray BrushPrefabs::get_brush(const BrushPrefabs::Type type, const int size) {
|
||||
/*
|
||||
var pixels = []
|
||||
if size < 1:
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
CIRCLE,
|
||||
};
|
||||
|
||||
static PoolVector3iArray get_brush(Type type, int size);
|
||||
static PoolVector3iArray get_brush(const Type type, const int size);
|
||||
|
||||
BrushPrefabs();
|
||||
~BrushPrefabs();
|
||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "paint_load_file_dialog.h"
|
||||
|
||||
void PaintLoadFileDialog::_on_LoadFileDialog_file_selected(String path) {
|
||||
void PaintLoadFileDialog::_on_LoadFileDialog_file_selected(const String &path) {
|
||||
/*
|
||||
file_path = path
|
||||
#print("1ere")
|
||||
|
@ -31,7 +31,7 @@ class PaintLoadFileDialog : public FileDialog {
|
||||
GDCLASS(PaintLoadFileDialog, FileDialog);
|
||||
|
||||
public:
|
||||
void _on_LoadFileDialog_file_selected(String path);
|
||||
void _on_LoadFileDialog_file_selected(const String &path);
|
||||
void _on_LoadFileDialog_confirmed();
|
||||
void load_img();
|
||||
void _on_LoadFileDialog_about_to_show();
|
||||
|
@ -33,7 +33,7 @@ void PaintSaveFileDialog::_ready() {
|
||||
add_filter("*.png ; PNG Images")
|
||||
*/
|
||||
}
|
||||
void PaintSaveFileDialog::_on_SaveFileDialog_file_selected(String path) {
|
||||
void PaintSaveFileDialog::_on_SaveFileDialog_file_selected(const String &path) {
|
||||
/*
|
||||
#print("selected file: ", path)
|
||||
file_path = path
|
||||
|
@ -32,7 +32,7 @@ class PaintSaveFileDialog : public FileDialog {
|
||||
|
||||
public:
|
||||
void _ready();
|
||||
void _on_SaveFileDialog_file_selected(String path);
|
||||
void _on_SaveFileDialog_file_selected(const String &path);
|
||||
void save_file();
|
||||
void _on_SaveFileDialog_about_to_show();
|
||||
void _on_SaveFileDialog_visibility_changed();
|
||||
|
@ -72,7 +72,7 @@ void PaintCanvas::_draw() {
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintCanvas::resize(int width, int height) {
|
||||
void PaintCanvas::resize(const int width, const int height) {
|
||||
/*
|
||||
if width < 0:
|
||||
width = 1
|
||||
@ -88,7 +88,7 @@ void PaintCanvas::resize(int width, int height) {
|
||||
layer.resize(width, height)
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::set_pixel_size(int size) {
|
||||
void PaintCanvas::set_pixel_size(const int size) {
|
||||
/*
|
||||
pixel_size = size
|
||||
set_grid_size(grid_size)
|
||||
@ -97,7 +97,7 @@ void PaintCanvas::set_pixel_size(int size) {
|
||||
set_canvas_height(canvas_height)
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::set_grid_size(int size) {
|
||||
void PaintCanvas::set_grid_size(const int size) {
|
||||
/*
|
||||
grid_size = size
|
||||
if not find_node("Grid"):
|
||||
@ -105,7 +105,7 @@ void PaintCanvas::set_grid_size(int size) {
|
||||
find_node("Grid").size = size * pixel_size
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::set_big_grid_size(int size) {
|
||||
void PaintCanvas::set_big_grid_size(const int size) {
|
||||
/*
|
||||
big_grid_size = size
|
||||
if not find_node("BigGrid"):
|
||||
@ -113,19 +113,19 @@ void PaintCanvas::set_big_grid_size(int size) {
|
||||
find_node("BigGrid").size = size * pixel_size
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::set_canvas_width(int val) {
|
||||
void PaintCanvas::set_canvas_width(const int val) {
|
||||
/*
|
||||
canvas_width = val
|
||||
rect_size.x = canvas_width * pixel_size
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::set_canvas_height(int val) {
|
||||
void PaintCanvas::set_canvas_height(const int val) {
|
||||
/*
|
||||
canvas_height = val
|
||||
rect_size.y = canvas_height * pixel_size
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::toggle_alpha_locked(String layer_name) {
|
||||
void PaintCanvas::toggle_alpha_locked(const String &layer_name) {
|
||||
/*
|
||||
var layer = find_layer_by_name(layer_name)
|
||||
layer.toggle_alpha_locked()
|
||||
@ -196,7 +196,7 @@ void PaintCanvas::clear_preview_layer() {
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintCanvas::clear_layer(String layer_name) {
|
||||
void PaintCanvas::clear_layer(const String &layer_name) {
|
||||
/*
|
||||
for layer in layers:
|
||||
if layer.name == layer_name:
|
||||
@ -204,7 +204,7 @@ void PaintCanvas::clear_layer(String layer_name) {
|
||||
break
|
||||
*/
|
||||
}
|
||||
Node *PaintCanvas::remove_layer(String layer_name) {
|
||||
Node *PaintCanvas::remove_layer(const String &layer_name) {
|
||||
/*
|
||||
# change current layer if the active layer is removed
|
||||
var del_layer = find_layer_by_name(layer_name)
|
||||
@ -219,7 +219,7 @@ Node *PaintCanvas::remove_layer(String layer_name) {
|
||||
return active_layer
|
||||
*/
|
||||
}
|
||||
Node *PaintCanvas::add_new_layer(String layer_name) {
|
||||
Node *PaintCanvas::add_new_layer(const String &layer_name) {
|
||||
/*
|
||||
for layer in layers:
|
||||
if layer.name == layer_name:
|
||||
@ -247,7 +247,7 @@ Node *PaintCanvas::add_new_layer(String layer_name) {
|
||||
return layer
|
||||
*/
|
||||
}
|
||||
Node *PaintCanvas::duplicate_layer(String layer_name, String new_layer_name) {
|
||||
Node *PaintCanvas::duplicate_layer(const String &layer_name, const String &new_layer_name) {
|
||||
/*
|
||||
for layer in layers:
|
||||
if layer.name == new_layer_name:
|
||||
@ -259,14 +259,14 @@ Node *PaintCanvas::duplicate_layer(String layer_name, String new_layer_name) {
|
||||
return layer
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::toggle_layer_visibility(String layer_name) {
|
||||
void PaintCanvas::toggle_layer_visibility(const String &layer_name) {
|
||||
/*
|
||||
for layer in layers:
|
||||
if layer.name == layer_name:
|
||||
layer.visible = not layer.visible
|
||||
*/
|
||||
}
|
||||
Node *PaintCanvas::find_layer_by_name(String layer_name) {
|
||||
Node *PaintCanvas::find_layer_by_name(const String &layer_name) {
|
||||
/*
|
||||
for layer in layers:
|
||||
if layer.name == layer_name:
|
||||
@ -274,7 +274,7 @@ Node *PaintCanvas::find_layer_by_name(String layer_name) {
|
||||
return null
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::toggle_lock_layer(String layer_name) {
|
||||
void PaintCanvas::toggle_lock_layer(const String &layer_name) {
|
||||
/*
|
||||
find_layer_by_name(layer_name).toggle_lock()
|
||||
*/
|
||||
@ -284,21 +284,21 @@ bool PaintCanvas::is_active_layer_locked() {
|
||||
return active_layer.locked
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::move_layer_forward(String layer_name) {
|
||||
void PaintCanvas::move_layer_forward(const String &layer_name) {
|
||||
/*
|
||||
var layer = find_layer_by_name(layer_name).texture_rect_ref
|
||||
var new_idx = max(layer.get_index() - 1, 0)
|
||||
canvas_layers.move_child(layer, new_idx)
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::move_layer_back(String layer_name) {
|
||||
void PaintCanvas::move_layer_back(const String &layer_name) {
|
||||
/*
|
||||
var layer = find_layer_by_name(layer_name).texture_rect_ref
|
||||
canvas_layers.move_child(layer, layer.get_index() + 1)
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintCanvas::select_layer(String layer_name) {
|
||||
void PaintCanvas::select_layer(const String &layer_name) {
|
||||
/*
|
||||
active_layer = find_layer_by_name(layer_name)
|
||||
*/
|
||||
@ -313,7 +313,7 @@ void PaintCanvas::_on_mouse_exited() {
|
||||
mouse_on_top = false
|
||||
*/
|
||||
}
|
||||
bool PaintCanvas::is_inside_canvas(int x, int y) {
|
||||
bool PaintCanvas::is_inside_canvas(const int x, const int y) {
|
||||
/*
|
||||
if x < 0 or y < 0:
|
||||
return false
|
||||
@ -326,66 +326,66 @@ bool PaintCanvas::is_inside_canvas(int x, int y) {
|
||||
//Note: Arrays are always passed by reference. To get a copy of an array which
|
||||
// can be modified independently of the original array, use duplicate.
|
||||
// (https://docs.godotengine.org/en/stable/classes/class_array.html)
|
||||
void PaintCanvas::set_pixel_arr(Array pixels, Color color) {
|
||||
void PaintCanvas::set_pixel_arr(const Array &pixels, const Color &color) {
|
||||
/*
|
||||
for pixel in pixels:
|
||||
_set_pixel(active_layer, pixel.x, pixel.y, color)
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::set_pixel_v(Vector2 pos, Color color) {
|
||||
void PaintCanvas::set_pixel_v(const Vector2 &pos, const Color &color) {
|
||||
/*
|
||||
set_pixel(pos.x, pos.y, color)
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::set_pixel(int x, int y, Color color) {
|
||||
void PaintCanvas::set_pixel(const int x, const int y, const Color &color) {
|
||||
/*
|
||||
_set_pixel(active_layer, x, y, color)
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::_set_pixel_v(PaintCanvasLayer *layer, Vector2 v, Color color) {
|
||||
void PaintCanvas::_set_pixel_v(PaintCanvasLayer *layer, const Vector2 &v, const Color &color) {
|
||||
/*
|
||||
_set_pixel(layer, v.x, v.y, color)
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::_set_pixel(PaintCanvasLayer *layer, int x, int y, Color color) {
|
||||
void PaintCanvas::_set_pixel(PaintCanvasLayer *layer, const int x, const int y, const Color &color) {
|
||||
/*
|
||||
if not is_inside_canvas(x, y):
|
||||
return
|
||||
layer.set_pixel(x, y, color)
|
||||
*/
|
||||
}
|
||||
Color PaintCanvas::get_pixel_v(Vector2 pos) {
|
||||
Color PaintCanvas::get_pixel_v(const Vector2 &pos) {
|
||||
/*
|
||||
return get_pixel(pos.x, pos.y)
|
||||
*/
|
||||
}
|
||||
Color PaintCanvas::get_pixel(int x, int y) {
|
||||
Color PaintCanvas::get_pixel(const int x, const int y) {
|
||||
/*
|
||||
if active_layer:
|
||||
return active_layer.get_pixel(x, y)
|
||||
return null
|
||||
*/
|
||||
}
|
||||
void PaintCanvas::set_preview_pixel_v(Vector2 pos, Color color) {
|
||||
void PaintCanvas::set_preview_pixel_v(const Vector2 &pos, const Color &color) {
|
||||
/*
|
||||
set_preview_pixel(pos.x, pos.y, color)
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintCanvas::set_preview_pixel(int x, int y, Color color) {
|
||||
void PaintCanvas::set_preview_pixel(const int x, const int y, const Color &color) {
|
||||
/*
|
||||
if not is_inside_canvas(x, y):
|
||||
return
|
||||
preview_layer.set_pixel(x, y, color)
|
||||
*/
|
||||
}
|
||||
Color PaintCanvas::get_preview_pixel_v(Vector2 pos) {
|
||||
Color PaintCanvas::get_preview_pixel_v(const Vector2 &pos) {
|
||||
/*
|
||||
return get_preview_pixel(pos.x, pos.y)
|
||||
*/
|
||||
}
|
||||
|
||||
Color PaintCanvas::get_preview_pixel(int x, int y) {
|
||||
Color PaintCanvas::get_preview_pixel(const int x, const int y) {
|
||||
/*
|
||||
if not preview_layer:
|
||||
return null
|
||||
@ -408,7 +408,7 @@ void PaintCanvas::hide_grid() {
|
||||
*/
|
||||
}
|
||||
|
||||
Array PaintCanvas::select_color(int x, int y) {
|
||||
Array PaintCanvas::select_color(const int x, const int y) {
|
||||
/*
|
||||
print("???")
|
||||
var same_color_pixels = []
|
||||
@ -421,7 +421,7 @@ Array PaintCanvas::select_color(int x, int y) {
|
||||
return same_color_pixels
|
||||
*/
|
||||
}
|
||||
Array PaintCanvas::select_same_color(int x, int y) {
|
||||
Array PaintCanvas::select_same_color(const int x, const int y) {
|
||||
/*
|
||||
return get_neighbouring_pixels(x, y)
|
||||
*/
|
||||
@ -430,7 +430,7 @@ Array PaintCanvas::select_same_color(int x, int y) {
|
||||
// returns array of Vector2
|
||||
// yoinked from
|
||||
// https://www.geeksforgeeks.org/flood-fill-algorithm-implement-fill-paint/
|
||||
Array PaintCanvas::get_neighbouring_pixels(int pos_x, int pos_y) {
|
||||
Array PaintCanvas::get_neighbouring_pixels(const int pos_x, const int pos_y) {
|
||||
/*
|
||||
var pixels = []
|
||||
|
||||
|
@ -38,15 +38,15 @@ public:
|
||||
void _process(float delta);
|
||||
void _draw();
|
||||
|
||||
void resize(int width, int height);
|
||||
void resize(const int width, const int height);
|
||||
|
||||
void set_pixel_size(int size);
|
||||
void set_grid_size(int size);
|
||||
void set_big_grid_size(int size);
|
||||
void set_canvas_width(int val);
|
||||
void set_canvas_height(int val);
|
||||
void set_pixel_size(const int size);
|
||||
void set_grid_size(const int size);
|
||||
void set_big_grid_size(const int size);
|
||||
void set_canvas_width(const int val);
|
||||
void set_canvas_height(const int val);
|
||||
|
||||
void toggle_alpha_locked(String layer_name);
|
||||
void toggle_alpha_locked(const String &layer_name);
|
||||
bool is_alpha_locked();
|
||||
|
||||
Rect2 get_content_margin();
|
||||
@ -56,41 +56,41 @@ public:
|
||||
Node *get_preview_layer();
|
||||
void clear_active_layer();
|
||||
void clear_preview_layer();
|
||||
void clear_layer(String layer_name);
|
||||
Node *remove_layer(String layer_name);
|
||||
Node *add_new_layer(String layer_name);
|
||||
Node *duplicate_layer(String layer_name, String new_layer_name);
|
||||
void toggle_layer_visibility(String layer_name);
|
||||
Node *find_layer_by_name(String layer_name);
|
||||
void toggle_lock_layer(String layer_name);
|
||||
void clear_layer(const String &layer_name);
|
||||
Node *remove_layer(const String &layer_name);
|
||||
Node *add_new_layer(const String &layer_name);
|
||||
Node *duplicate_layer(const String &layer_name, const String &new_layer_name);
|
||||
void toggle_layer_visibility(const String &layer_name);
|
||||
Node *find_layer_by_name(const String &layer_name);
|
||||
void toggle_lock_layer(const String &layer_name);
|
||||
bool is_active_layer_locked();
|
||||
void move_layer_forward(String layer_name);
|
||||
void move_layer_back(String layer_name);
|
||||
void select_layer(String layer_name);
|
||||
void move_layer_forward(const String &layer_name);
|
||||
void move_layer_back(const String &layer_name);
|
||||
void select_layer(const String &layer_name);
|
||||
|
||||
void _on_mouse_entered();
|
||||
void _on_mouse_exited();
|
||||
|
||||
bool is_inside_canvas(int x, int y);
|
||||
void set_pixel_arr(Array pixels, Color color);
|
||||
void set_pixel_v(Vector2 pos, Color color);
|
||||
void set_pixel(int x, int y, Color color);
|
||||
void _set_pixel_v(PaintCanvasLayer *layer, Vector2 v, Color color);
|
||||
void _set_pixel(PaintCanvasLayer *layer, int x, int y, Color color);
|
||||
Color get_pixel_v(Vector2 pos);
|
||||
Color get_pixel(int x, int y);
|
||||
void set_preview_pixel_v(Vector2 pos, Color color);
|
||||
void set_preview_pixel(int x, int y, Color color);
|
||||
Color get_preview_pixel_v(Vector2 pos);
|
||||
Color get_preview_pixel(int x, int y);
|
||||
bool is_inside_canvas(const int x, const int y);
|
||||
void set_pixel_arr(const Array &pixels, const Color &color);
|
||||
void set_pixel_v(const Vector2 &pos, const Color &color);
|
||||
void set_pixel(const int x, const int y, const Color &color);
|
||||
void _set_pixel_v(PaintCanvasLayer *layer, const Vector2 &v, const Color &color);
|
||||
void _set_pixel(PaintCanvasLayer *layer, const int x, const int y, const Color &color);
|
||||
Color get_pixel_v(const Vector2 &pos);
|
||||
Color get_pixel(const int x, const int y);
|
||||
void set_preview_pixel_v(const Vector2 &pos, const Color &color);
|
||||
void set_preview_pixel(const int x, const int y, const Color &color);
|
||||
Color get_preview_pixel_v(const Vector2 &pos);
|
||||
Color get_preview_pixel(const int x, const int y);
|
||||
|
||||
void toggle_grid();
|
||||
void show_grid();
|
||||
void hide_grid();
|
||||
|
||||
Array select_color(int x, int y);
|
||||
Array select_same_color(int x, int y);
|
||||
Array get_neighbouring_pixels(int pos_x, int pos_y);
|
||||
Array select_color(const int x, const int y);
|
||||
Array select_same_color(const int x, const int y);
|
||||
Array get_neighbouring_pixels(const int pos_x, const int pos_y);
|
||||
|
||||
PaintCanvas();
|
||||
~PaintCanvas();
|
||||
|
@ -30,12 +30,12 @@ SOFTWARE.
|
||||
bool PaintCanvasLayer::get_visible() {
|
||||
return _visible;
|
||||
}
|
||||
void PaintCanvasLayer::set_visible(bool vis) {
|
||||
void PaintCanvasLayer::set_visible(const bool vis) {
|
||||
_visible = vis;
|
||||
texture_rect_ref->set_visible(_visible);
|
||||
}
|
||||
|
||||
void PaintCanvasLayer::create(TextureRect *p_texture_rect_ref, int width, int height) {
|
||||
void PaintCanvasLayer::create(TextureRect *p_texture_rect_ref, const int width, const int height) {
|
||||
texture_rect_ref = p_texture_rect_ref;
|
||||
|
||||
layer_width = width;
|
||||
@ -48,7 +48,7 @@ void PaintCanvasLayer::create(TextureRect *p_texture_rect_ref, int width, int he
|
||||
update_texture();
|
||||
}
|
||||
|
||||
void PaintCanvasLayer::resize(int width, int height) {
|
||||
void PaintCanvasLayer::resize(const int width, const int height) {
|
||||
PoolColorArray pixel_colors;
|
||||
int prev_width = layer_width;
|
||||
int prev_height = layer_height;
|
||||
@ -84,12 +84,12 @@ void PaintCanvasLayer::resize(int width, int height) {
|
||||
|
||||
update_texture();
|
||||
}
|
||||
void PaintCanvasLayer::set_pixel(int x, int y, Color color) {
|
||||
void PaintCanvasLayer::set_pixel(const int x, const int y, const Color &color) {
|
||||
image->lock();
|
||||
image->set_pixel(x, y, color);
|
||||
image->unlock();
|
||||
}
|
||||
Color PaintCanvasLayer::get_pixel(int x, int y) {
|
||||
Color PaintCanvasLayer::get_pixel(const int x, const int y) {
|
||||
if (x < 0 || y < 0 || x >= image->get_width() || y >= image->get_height()) {
|
||||
return Color();
|
||||
}
|
||||
|
@ -49,13 +49,13 @@ public:
|
||||
TextureRect *texture_rect_ref;
|
||||
|
||||
bool get_visible();
|
||||
void set_visible(bool vis);
|
||||
void set_visible(const bool vis);
|
||||
|
||||
void create(TextureRect *p_texture_rect_ref, int width, int height);
|
||||
void create(TextureRect *p_texture_rect_ref, const int width, const int height);
|
||||
|
||||
void resize(int width, int height);
|
||||
void set_pixel(int x, int y, Color color);
|
||||
Color get_pixel(int x, int y);
|
||||
void resize(const int width, const int height);
|
||||
void set_pixel(const int x, const int y, const Color &color);
|
||||
Color get_pixel(const int x, const int y);
|
||||
void clear();
|
||||
void update_texture();
|
||||
|
||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "paint_canvas_outline.h"
|
||||
|
||||
void PaintCanvasOutline::draw_outline_box(Vector2 pos, Vector2 size, Color color, int width) {
|
||||
void PaintCanvasOutline::draw_outline_box(const Vector2 &pos, const Vector2 &size, const Color &color, const int width) {
|
||||
//Top line
|
||||
draw_line(pos, pos + Vector2(size.x, 0), color, width);
|
||||
//Left line
|
||||
|
@ -31,7 +31,7 @@ class PaintCanvasOutline : public Control {
|
||||
GDCLASS(PaintCanvasOutline, Control);
|
||||
|
||||
public:
|
||||
void draw_outline_box(Vector2 pos, Vector2 size, Color color, int width);
|
||||
void draw_outline_box(const Vector2 &pos, const Vector2 &size, const Color &color, const int width);
|
||||
|
||||
PaintCanvasOutline();
|
||||
~PaintCanvasOutline();
|
||||
|
@ -27,7 +27,7 @@ SOFTWARE.
|
||||
#include "mdi_gizmo.h"
|
||||
#include "mdi_gizmo_plugin.h"
|
||||
|
||||
void PaintEditorPlugin::make_visible(bool visible) {
|
||||
void PaintEditorPlugin::make_visible(const bool visible) {
|
||||
/*
|
||||
if editor_scene:
|
||||
editor_scene.visible = visible
|
||||
|
@ -29,7 +29,7 @@ class PaintEditorPlugin : public EditorPlugin {
|
||||
GDCLASS(PaintEditorPlugin, EditorPlugin);
|
||||
|
||||
public:
|
||||
void make_visible(bool visible);
|
||||
void make_visible(const bool visible);
|
||||
const Ref<Texture> get_icon() const;
|
||||
bool has_main_screen() const;
|
||||
String get_name() const;
|
||||
|
@ -48,7 +48,7 @@ void PaintNavbar::_ready() {
|
||||
i.connect("item_pressed", self, "button_pressed")
|
||||
*/
|
||||
}
|
||||
void PaintNavbar::button_pressed(String button_name, Node *button_item, int id) {
|
||||
void PaintNavbar::button_pressed(const String &button_name, Node *button_item, const int id) {
|
||||
/*
|
||||
# print("pressed: ", button_name)
|
||||
# print("pressed item is: '%s'" % button_item)
|
||||
@ -71,7 +71,7 @@ void PaintNavbar::button_pressed(String button_name, Node *button_item, int id)
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintNavbar::handle_file_menu(String pressed_item, int id) {
|
||||
void PaintNavbar::handle_file_menu(const String &pressed_item, const int id) {
|
||||
/*
|
||||
match pressed_item:
|
||||
"Save":
|
||||
@ -82,14 +82,14 @@ void PaintNavbar::handle_file_menu(String pressed_item, int id) {
|
||||
owner.get_node("ConfirmationDialog").show()
|
||||
*/
|
||||
}
|
||||
void PaintNavbar::handle_edit_menu(String pressed_item, int id) {
|
||||
void PaintNavbar::handle_edit_menu(const String &pressed_item, const int id) {
|
||||
/*
|
||||
match pressed_item:
|
||||
"Add Layer":
|
||||
editor.add_new_layer()
|
||||
*/
|
||||
}
|
||||
void PaintNavbar::handle_canvas_menu(String pressed_item, int id) {
|
||||
void PaintNavbar::handle_canvas_menu(const String &pressed_item, const int id) {
|
||||
/*
|
||||
match pressed_item:
|
||||
"Change Size":
|
||||
@ -98,7 +98,7 @@ void PaintNavbar::handle_canvas_menu(String pressed_item, int id) {
|
||||
owner.paint_canvas.crop_to_content()
|
||||
*/
|
||||
}
|
||||
void PaintNavbar::handle_layer_menu(String pressed_item, int id) {
|
||||
void PaintNavbar::handle_layer_menu(const String &pressed_item, const int id) {
|
||||
/*
|
||||
match pressed_item:
|
||||
"Add Layer":
|
||||
@ -115,7 +115,7 @@ void PaintNavbar::handle_layer_menu(String pressed_item, int id) {
|
||||
owner.find_node("LockAlpha").pressed = $Buttons/Layer.get_popup().is_item_checked(id)
|
||||
*/
|
||||
}
|
||||
void PaintNavbar::handle_grid_menu(String pressed_item, int id) {
|
||||
void PaintNavbar::handle_grid_menu(const String &pressed_item, const int id) {
|
||||
/*
|
||||
match pressed_item:
|
||||
"Change Grid Size":
|
||||
@ -125,14 +125,14 @@ void PaintNavbar::handle_grid_menu(String pressed_item, int id) {
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintNavbar::handle_magic_menu(String pressed_item, int id) {
|
||||
void PaintNavbar::handle_magic_menu(const String &pressed_item, const int id) {
|
||||
/*
|
||||
match pressed_item:
|
||||
"Add Layer":
|
||||
editor.add_new_layer()
|
||||
*/
|
||||
}
|
||||
void PaintNavbar::handle_editor_menu(String pressed_item, int id) {
|
||||
void PaintNavbar::handle_editor_menu(const String &pressed_item, const int id) {
|
||||
/*
|
||||
match pressed_item:
|
||||
"Settings":
|
||||
|
@ -32,16 +32,16 @@ class PaintNavbar : public Control {
|
||||
|
||||
public:
|
||||
void _ready();
|
||||
void button_pressed(String button_name, Node *button_item, int id);
|
||||
void button_pressed(const String &button_name, Node *button_item, const int id);
|
||||
|
||||
void handle_file_menu(String pressed_item, int id);
|
||||
void handle_edit_menu(String pressed_item, int id);
|
||||
void handle_canvas_menu(String pressed_item, int id);
|
||||
void handle_layer_menu(String pressed_item, int id);
|
||||
void handle_grid_menu(String pressed_item, int id);
|
||||
void handle_file_menu(const String &pressed_item, const int id);
|
||||
void handle_edit_menu(const String &pressed_item, const int id);
|
||||
void handle_canvas_menu(const String &pressed_item, const int id);
|
||||
void handle_layer_menu(const String &pressed_item, const int id);
|
||||
void handle_grid_menu(const String &pressed_item, const int id);
|
||||
|
||||
void handle_magic_menu(String pressed_item, int id);
|
||||
void handle_editor_menu(String pressed_item, int id);
|
||||
void handle_magic_menu(const String &pressed_item, const int id);
|
||||
void handle_editor_menu(const String &pressed_item, const int id);
|
||||
bool is_any_menu_open();
|
||||
|
||||
PaintNavbar();
|
||||
|
@ -35,7 +35,7 @@ if not rect_size == Vector2():
|
||||
draw_outline_box(rect_size, Color.gray, outline_size)
|
||||
*/
|
||||
}
|
||||
void PaintSelectionBox::draw_outline_box(Vector2 size, Color color, int width) {
|
||||
void PaintSelectionBox::draw_outline_box(const Vector2 &size, const Color &color, const int width) {
|
||||
/*
|
||||
#Top line
|
||||
draw_line(Vector2(0 + 1, 0), Vector2(size.x, 0), color, width)
|
||||
|
@ -33,7 +33,7 @@ class PaintSelectionBox : public Control {
|
||||
public:
|
||||
void _process(float delta);
|
||||
void _draw();
|
||||
void draw_outline_box(Vector2 size, Color color, int width);
|
||||
void draw_outline_box(const Vector2 &size, const Color &color, const int width);
|
||||
|
||||
PaintSelectionBox();
|
||||
~PaintSelectionBox();
|
||||
|
@ -30,12 +30,12 @@ void PaintTextInfo::_enter_tree() {
|
||||
editor = get_parent()
|
||||
*/
|
||||
}
|
||||
void PaintTextInfo::_on_ColorPickerButton_color_changed(Color color) {
|
||||
void PaintTextInfo::_on_ColorPickerButton_color_changed(const Color &color) {
|
||||
/*
|
||||
canvas_outline.color = color
|
||||
*/
|
||||
}
|
||||
void PaintTextInfo::_on_CheckButton_toggled(bool button_pressed) {
|
||||
void PaintTextInfo::_on_CheckButton_toggled(const bool button_pressed) {
|
||||
/*
|
||||
canvas_outline.visible = button_pressed
|
||||
*/
|
||||
|
@ -32,8 +32,8 @@ class PaintTextInfo : public Control {
|
||||
|
||||
public:
|
||||
void _enter_tree();
|
||||
void _on_ColorPickerButton_color_changed(Color color);
|
||||
void _on_CheckButton_toggled(bool button_pressed);
|
||||
void _on_ColorPickerButton_color_changed(const Color &color);
|
||||
void _on_CheckButton_toggled(const bool button_pressed);
|
||||
void _on_Ok_pressed();
|
||||
|
||||
PaintTextInfo();
|
||||
|
@ -31,8 +31,8 @@ class PaintTextInfo : public Control {
|
||||
GDCLASS(PaintTextInfo, Control);
|
||||
|
||||
public:
|
||||
void add_text_info(String text_name, Node *custom_node = nullptr);
|
||||
void update_text_info(String text_name, Node *text_value = nullptr, Node *node = nullptr, Node *node_target_value = nullptr, Node *node_value = nullptr);
|
||||
void add_text_info(const String &text_name, Node *custom_node = nullptr);
|
||||
void update_text_info(const String &text_name, Node *text_value = nullptr, Node *node = nullptr, Node *node_target_value = nullptr, Node *node_value = nullptr);
|
||||
|
||||
PaintTextInfo();
|
||||
~PaintTextInfo();
|
||||
|
@ -24,7 +24,7 @@ SOFTWARE.
|
||||
|
||||
#include "paint_window.h"
|
||||
|
||||
void PaintWindow::_input(Ref<InputEvent> event) {
|
||||
void PaintWindow::_input(const Ref<InputEvent> &event) {
|
||||
/*
|
||||
if is_any_menu_open():
|
||||
return
|
||||
@ -131,7 +131,7 @@ void PaintWindow::_process(float delta) {
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintWindow::_handle_shortcuts(int scancode) {
|
||||
void PaintWindow::_handle_shortcuts(const int scancode) {
|
||||
/*
|
||||
match scancode:
|
||||
K_UNDO:
|
||||
@ -221,7 +221,7 @@ void PaintWindow::_handle_scroll() {
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintWindow::_handle_zoom(Ref<InputEvent> event) {
|
||||
void PaintWindow::_handle_zoom(const Ref<InputEvent> &event) {
|
||||
/*
|
||||
if not event is InputEventMouseButton:
|
||||
return
|
||||
@ -361,7 +361,7 @@ void PaintWindow::_on_Save_pressed() {
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintWindow::do_action(Array data) {
|
||||
void PaintWindow::do_action(const Array &data) {
|
||||
/*
|
||||
if _current_action == null:
|
||||
#print("clear redo")
|
||||
@ -448,12 +448,12 @@ Ref<PaintAction> PaintWindow::get_action() {
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintWindow::set_selected_color(Color color) {
|
||||
void PaintWindow::set_selected_color(const Color &color) {
|
||||
/*
|
||||
selected_color = color
|
||||
*/
|
||||
}
|
||||
void PaintWindow::set_brush(PaintWindow::Tools new_mode) {
|
||||
void PaintWindow::set_brush(const PaintWindow::Tools new_mode) {
|
||||
/*
|
||||
if brush_mode == new_mode:
|
||||
return
|
||||
@ -474,7 +474,7 @@ void PaintWindow::set_brush(PaintWindow::Tools new_mode) {
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintWindow::change_color(Color new_color) {
|
||||
void PaintWindow::change_color(const Color &new_color) {
|
||||
/*
|
||||
if new_color.a == 0:
|
||||
return
|
||||
@ -483,7 +483,7 @@ void PaintWindow::change_color(Color new_color) {
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintWindow::_on_ColorPicker_color_changed(Color color) {
|
||||
void PaintWindow::_on_ColorPicker_color_changed(const Color &color) {
|
||||
/*
|
||||
selected_color = color
|
||||
*/
|
||||
@ -544,7 +544,7 @@ void PaintWindow::_on_Editor_visibility_changed() {
|
||||
*/
|
||||
}
|
||||
|
||||
void PaintWindow::highlight_layer(String layer_name) {
|
||||
void PaintWindow::highlight_layer(const String &layer_name) {
|
||||
/*
|
||||
for button in layer_buttons.get_children():
|
||||
if paint_canvas.find_layer_by_name(button.name).locked:
|
||||
@ -555,20 +555,20 @@ void PaintWindow::highlight_layer(String layer_name) {
|
||||
button.get("custom_styles/panel").set("bg_color", other_layer_highlight)
|
||||
*/
|
||||
}
|
||||
void PaintWindow::toggle_layer_visibility(Node *button, String layer_name) {
|
||||
void PaintWindow::toggle_layer_visibility(Node *button, const String &layer_name) {
|
||||
/*
|
||||
#print("toggling: ", layer_name)
|
||||
paint_canvas.toggle_layer_visibility(layer_name)
|
||||
*/
|
||||
}
|
||||
void PaintWindow::select_layer(String layer_name) {
|
||||
void PaintWindow::select_layer(const String &layer_name) {
|
||||
/*
|
||||
#print("select layer: ", layer_name)
|
||||
paint_canvas.select_layer(layer_name)
|
||||
highlight_layer(layer_name)
|
||||
*/
|
||||
}
|
||||
void PaintWindow::lock_layer(Node *button, String layer_name) {
|
||||
void PaintWindow::lock_layer(Node *button, const String &layer_name) {
|
||||
/*
|
||||
paint_canvas.toggle_lock_layer(layer_name)
|
||||
highlight_layer(paint_canvas.get_active_layer().name)
|
||||
@ -696,7 +696,7 @@ void PaintWindow::_on_ColorPicker_popup_closed() {
|
||||
*/
|
||||
}
|
||||
|
||||
bool PaintWindow::is_position_in_canvas(Vector2 pos) {
|
||||
bool PaintWindow::is_position_in_canvas(const Vector2 &pos) {
|
||||
/*
|
||||
if Rect2(paint_canvas_container_node.rect_global_position,
|
||||
paint_canvas_container_node.rect_global_position + paint_canvas_container_node.rect_size).has_point(pos):
|
||||
|
@ -71,15 +71,15 @@ public:
|
||||
max_zoom_in = 50,
|
||||
};
|
||||
|
||||
void _input(Ref<InputEvent> event);
|
||||
void _input(const Ref<InputEvent> &event);
|
||||
void _process(float delta);
|
||||
|
||||
void _handle_shortcuts(int scancode);
|
||||
void _handle_shortcuts(const int scancode);
|
||||
void _draw_tool_brush();
|
||||
|
||||
void _handle_scroll();
|
||||
|
||||
void _handle_zoom(Ref<InputEvent> event);
|
||||
void _handle_zoom(const Ref<InputEvent> &event);
|
||||
|
||||
void _handle_cut();
|
||||
void brush_process();
|
||||
@ -87,19 +87,19 @@ public:
|
||||
|
||||
void _on_Save_pressed();
|
||||
|
||||
void do_action(Array data);
|
||||
void do_action(const Array &data);
|
||||
void commit_action();
|
||||
void redo_action();
|
||||
void undo_action();
|
||||
|
||||
Ref<PaintAction> get_action();
|
||||
|
||||
void set_selected_color(Color color);
|
||||
void set_brush(Tools new_mode);
|
||||
void set_selected_color(const Color &color);
|
||||
void set_brush(const Tools new_mode);
|
||||
|
||||
void change_color(Color new_color);
|
||||
void change_color(const Color &new_color);
|
||||
|
||||
void _on_ColorPicker_color_changed(Color color);
|
||||
void _on_ColorPicker_color_changed(const Color &color);
|
||||
void _on_PaintTool_pressed();
|
||||
void _on_BucketTool_pressed();
|
||||
void _on_RainbowTool_pressed();
|
||||
@ -112,10 +112,10 @@ public:
|
||||
void _on_CutTool_pressed();
|
||||
void _on_Editor_visibility_changed();
|
||||
|
||||
void highlight_layer(String layer_name);
|
||||
void toggle_layer_visibility(Node *button, String layer_name);
|
||||
void select_layer(String layer_name);
|
||||
void lock_layer(Node *button, String layer_name);
|
||||
void highlight_layer(const String &layer_name);
|
||||
void toggle_layer_visibility(Node *button, const String &layer_name);
|
||||
void select_layer(const String &layer_name);
|
||||
void lock_layer(Node *button, const String &layer_name);
|
||||
|
||||
Ref<PaintCanvasLayer> add_new_layer();
|
||||
void remove_active_layer();
|
||||
@ -131,7 +131,7 @@ public:
|
||||
void _on_PaintCanvasContainer_mouse_exited();
|
||||
void _on_ColorPicker_popup_closed();
|
||||
|
||||
bool is_position_in_canvas(Vector2 pos);
|
||||
bool is_position_in_canvas(const Vector2 &pos);
|
||||
|
||||
bool is_mouse_in_canvas();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user