Repository: godotengine/godot (language: cpp)

Issue:
Debug CanvasItem Redraws is incorrectly offset
### Tested versions

4.3.stable
Master - Godot v4.4.beta (a63a8b430)

### System information

Godot v4.4.beta (a63a8b430) - Windows 11 (build 22631) - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4070 Laptop GPU (NVIDIA; 32.0.15.6614) - AMD Ryzen 7 7840HS w/ Radeon 780M Graphics (16 threads)

### Issue description

Debug CanvasItem Redraws is incorrectly offset

https://github.com/user-attachments/assets/816ac542-aa83-446c-9195-8a09c095d405

### Steps to reproduce

Enable "Debug CanvasItem Redraws" in the Debug menu and play a scene with some sprites that you call redraw on.

### Minimal reproduction project (MRP)

[debug-canvasitem-redraws-issue.zip](https://github.com/user-attachments/files/18849409/debug-canvasitem-redraws-issue.zip)


Discussion / hints:

Fix patch:
diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp
index 6da4d24e7256..5cea736eeb15 100644
--- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp
@@ -2913,12 +2913,13 @@ void RendererCanvasRenderRD::_record_item_commands(const Item *p_item, RenderTar
 			r_current_batch->tex_info = tex_info;
 		}
 
+		_update_transform_2d_to_mat2x3(base_transform, world);
 		InstanceData *instance_data = new_instance_data(world, lights, base_flags, r_index, uniforms_ofs, tex_info);
 
 		Rect2 src_rect;
 		Rect2 dst_rect;
 
-		dst_rect = Rect2(Vector2(), p_item->rect.size);
+		dst_rect = p_item->rect;
 		if (dst_rect.size.width < 0) {
 			dst_rect.position.x += dst_rect.size.width;
 			dst_rect.size.width *= -1;


Test patch: