diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/canvas_item_editor_plugin.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index b4618a4eb6..b2d2704f07 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -2741,10 +2741,11 @@ void CanvasItemEditor::_draw_selection() { if (canvas_item->_edit_use_pivot()) { // Draw the node's pivot - Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * Transform2D(canvas_item->_edit_get_rotation(), canvas_item->_edit_get_position())).orthonormalized(); + Transform2D unscaled_transform = (xform * canvas_item->get_transform().affine_inverse() * Transform2D(canvas_item->_edit_get_rotation(), canvas_item->_edit_get_position() + canvas_item->_edit_get_pivot())).orthonormalized(); Transform2D simple_xform = viewport->get_transform() * unscaled_transform; + viewport->draw_set_transform_matrix(simple_xform); - viewport->draw_texture(pivot_icon, canvas_item->_edit_get_pivot() - (pivot_icon->get_size() / 2).floor()); + viewport->draw_texture(pivot_icon, -(pivot_icon->get_size() / 2).floor()); viewport->draw_set_transform_matrix(viewport->get_transform()); } |