Skip to content

Commit

Permalink
Merge pull request #84076 from aXu-AP/uv-editor-texture-transform
Browse files Browse the repository at this point in the history
Fix UV editor not using texture transform
  • Loading branch information
akien-mga committed Dec 4, 2023
2 parents 628af13 + d7e5c25 commit 9108445
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion editor/plugins/polygon_2d_editor_plugin.cpp
Expand Up @@ -989,7 +989,10 @@ void Polygon2DEditor::_uv_draw() {
mtx.columns[2] = -uv_draw_ofs;
mtx.scale_basis(Vector2(uv_draw_zoom, uv_draw_zoom));

RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), mtx);
Transform2D texture_transform = Transform2D(node->get_texture_rotation(), node->get_texture_offset());
texture_transform.scale(node->get_texture_scale());
texture_transform.affine_invert();
RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), mtx * texture_transform);
uv_edit_draw->draw_texture(base_tex, Point2());
RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), Transform2D());

Expand Down

0 comments on commit 9108445

Please sign in to comment.