Clear using the color (0, 0, 0, 0), instead of (1, 1, 1, 0) in the paint module.

This commit is contained in:
Relintai 2022-11-28 15:02:02 +01:00
parent 900605e2c9
commit e0d09a2633
2 changed files with 6 additions and 6 deletions

View File

@ -125,10 +125,10 @@ void CutAction::_commit_action() {
redo_cells.append(pos); redo_cells.append(pos);
redo_colors.append(color); redo_colors.append(color);
_paint_canvas->set_pixel_v(pos, Color(1, 1, 1, 0)); _paint_canvas->set_pixel_v(pos, Color(0, 0, 0, 0));
undo_cells.append(pos); undo_cells.append(pos);
undo_colors.append(Color(1, 1, 1, 0)); undo_colors.append(Color(0, 0, 0, 0));
} }
} }
} }

View File

@ -176,13 +176,13 @@ Color PaintCanvas::get_preview_pixel(const int x, const int y) {
} }
void PaintCanvas::clear() { void PaintCanvas::clear() {
_image->fill(Color(1.00, 1.00, 1.00, 0.00)); _image->fill(Color(0.00, 0.00, 0.00, 0.00));
_image_texture->create_from_image(_image, 0); _image_texture->create_from_image(_image, 0);
} }
void PaintCanvas::clear_preview() { void PaintCanvas::clear_preview() {
_preview_image->fill(Color(1.00, 1.00, 1.00, 0.00)); _preview_image->fill(Color(0.00, 0.00, 0.00, 0.00));
_preview_image_texture->create_from_image(_preview_image, 0); _preview_image_texture->create_from_image(_preview_image, 0);
} }
@ -748,7 +748,7 @@ void PaintCanvas::tool_process(const Vector2 &local_position, const Ref<InputEve
if (_mouse_button_down == BUTTON_LEFT) { if (_mouse_button_down == BUTTON_LEFT) {
arr.push_back(get_current_color()); arr.push_back(get_current_color());
} else if (_mouse_button_down == BUTTON_RIGHT) { } else if (_mouse_button_down == BUTTON_RIGHT) {
arr.push_back(Color(1, 1, 1, 0)); arr.push_back(Color(0, 0, 0, 0));
} }
do_action(arr); do_action(arr);
@ -769,7 +769,7 @@ void PaintCanvas::tool_process(const Vector2 &local_position, const Ref<InputEve
if (_mouse_button_down == BUTTON_LEFT) { if (_mouse_button_down == BUTTON_LEFT) {
arr.push_back(get_current_color()); arr.push_back(get_current_color());
} else if (_mouse_button_down == BUTTON_RIGHT) { } else if (_mouse_button_down == BUTTON_RIGHT) {
arr.push_back(Color(1, 1, 1, 0)); arr.push_back(Color(0, 0, 0, 0));
} }
arr.push_back(_brush_prefab); arr.push_back(_brush_prefab);