From fed839a2350d91d295d38a3605508bda319263fc Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 21 Jun 2022 22:27:44 +0200 Subject: [PATCH] Fix resizing PaintCanvas. --- modules/paint/paint_canvas.cpp | 3 +++ modules/paint/paint_visual_grid.cpp | 2 +- modules/paint/paint_visual_grid.h | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/paint/paint_canvas.cpp b/modules/paint/paint_canvas.cpp index 618c6ba14..7d4827ef3 100644 --- a/modules/paint/paint_canvas.cpp +++ b/modules/paint/paint_canvas.cpp @@ -533,6 +533,9 @@ void PaintCanvas::resize(int width, int height) { height = 1; } + _canvas_width = width; + _canvas_height = height; + Size2 s; s.x = _canvas_height * _pixel_size; s.y = _canvas_width * _pixel_size; diff --git a/modules/paint/paint_visual_grid.cpp b/modules/paint/paint_visual_grid.cpp index 511f040ca..35d6a6fe0 100644 --- a/modules/paint/paint_visual_grid.cpp +++ b/modules/paint/paint_visual_grid.cpp @@ -102,7 +102,7 @@ void PaintVisualGrid::_notification(int p_what) { PaintVisualGrid::PaintVisualGrid() { color = Color(1, 1, 1, 0.42); size = 16; - zoom = 0; + //zoom = 0; } PaintVisualGrid::~PaintVisualGrid() { diff --git a/modules/paint/paint_visual_grid.h b/modules/paint/paint_visual_grid.h index 0f43c2bf8..4e48398b5 100644 --- a/modules/paint/paint_visual_grid.h +++ b/modules/paint/paint_visual_grid.h @@ -40,8 +40,8 @@ public: Color color; int size; - float zoom; - Vector2 offset; + //float zoom; + //Vector2 offset; protected: void _notification(int p_what);