From 918a246ef4f941bb533b5ed59992f75db16e94c1 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 21 Jun 2022 16:28:17 +0200 Subject: [PATCH] Fixed the tool layer. --- modules/paint/paint_canvas_layer.cpp | 2 -- modules/paint/paint_window.cpp | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/paint/paint_canvas_layer.cpp b/modules/paint/paint_canvas_layer.cpp index 62d598774..9c13f8d81 100644 --- a/modules/paint/paint_canvas_layer.cpp +++ b/modules/paint/paint_canvas_layer.cpp @@ -117,8 +117,6 @@ void PaintCanvasLayer::update_texture() { texture->create_from_image(image, 0); texture_rect_ref->set_texture(texture); - texture_rect_ref->set_margin(Margin::MARGIN_RIGHT, 0); - texture_rect_ref->set_margin(Margin::MARGIN_BOTTOM, 0); } void PaintCanvasLayer::toggle_lock() { diff --git a/modules/paint/paint_window.cpp b/modules/paint/paint_window.cpp index d269e2a9a..b7300340f 100644 --- a/modules/paint/paint_window.cpp +++ b/modules/paint/paint_window.cpp @@ -304,6 +304,7 @@ void PaintWindow::_draw_tool_brush() { for (int i = 0; i < pixels.size(); ++i) { Vector2i pixel = r[i]; paint_canvas->_set_pixel(paint_canvas->tool_layer, cell_mouse_position.x + pixel.x, cell_mouse_position.y + pixel.y, _selected_color); + //print_error("ad " + String::num(cell_mouse_position.x + pixel.x) + " " + String::num(cell_mouse_position.y + pixel.y)); } r.release(); @@ -321,7 +322,7 @@ void PaintWindow::_draw_tool_brush() { paint_canvas->update(); //TODO add here brush prefab drawing - paint_canvas->tool_layer->update_texture(); + // paint_canvas->tool_layer->update_texture(); } void PaintWindow::_handle_scroll() { @@ -983,7 +984,7 @@ void PaintWindow::_on_PaintCanvasContainer_mouse_entered() { mouse_on_top = true; paint_canvas->tool_layer->clear(); paint_canvas->update(); - paint_canvas->tool_layer->update_texture(); + //paint_canvas->tool_layer->update_texture(); } void PaintWindow::_on_PaintCanvasContainer_mouse_exited() { if (!mouse_on_top) { @@ -993,7 +994,7 @@ void PaintWindow::_on_PaintCanvasContainer_mouse_exited() { mouse_on_top = false; paint_canvas->tool_layer->clear(); paint_canvas->update(); - paint_canvas->tool_layer->update_texture(); + //paint_canvas->tool_layer->update_texture(); } void PaintWindow::_on_ColorPicker_popup_closed() { color_grid->add_color_prefab(color_picker_button->get_pick_color());