Merge pull request #57082 from madmiraal/fix-50802

This commit is contained in:
Rémi Verschelde 2022-01-23 17:27:10 +01:00 committed by GitHub
commit dda6d2674a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -790,7 +790,7 @@ void Viewport::update_canvas_items() {
}
void Viewport::_set_size(const Size2i &p_size, const Size2i &p_size_2d_override, const Rect2i &p_to_screen_rect, const Transform2D &p_stretch_transform, bool p_allocated) {
if (size == p_size && size_allocated == p_allocated && stretch_transform == p_stretch_transform && p_size_2d_override == size_2d_override && to_screen_rect != p_to_screen_rect) {
if (size == p_size && size_allocated == p_allocated && stretch_transform == p_stretch_transform && p_size_2d_override == size_2d_override && to_screen_rect == p_to_screen_rect) {
return;
}
@ -1090,7 +1090,7 @@ Transform2D Viewport::_get_input_pre_xform() const {
if (to_screen_rect.size.x != 0 && to_screen_rect.size.y != 0) {
pre_xf.elements[2] = -to_screen_rect.position;
pre_xf.scale(size / to_screen_rect.size);
pre_xf.scale(Vector2(size) / to_screen_rect.size);
}
return pre_xf;