Skip to content

Commit

Permalink
Revert incorrect rounding when 2D transform snapping
Browse files Browse the repository at this point in the history
  • Loading branch information
kleonc committed Oct 15, 2024
1 parent af77100 commit 8d3e9aa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions servers/rendering/renderer_canvas_cull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void RendererCanvasCull::_collect_ysort_children(RendererCanvasCull::Item *p_can
}

if (snapping_2d_transforms_to_pixel) {
child_xform.columns[2] = child_xform.columns[2].round();
child_xform.columns[2] = (child_xform.columns[2] + Point2(0.5, 0.5)).floor();
}

r_items[r_index] = child_items[i];
Expand Down Expand Up @@ -303,8 +303,8 @@ void RendererCanvasCull::_cull_canvas_item(Item *p_canvas_item, const Transform2
Transform2D parent_xform = p_parent_xform;

if (snapping_2d_transforms_to_pixel) {
self_xform.columns[2] = self_xform.columns[2].round();
parent_xform.columns[2] = parent_xform.columns[2].round();
self_xform.columns[2] = (self_xform.columns[2] + Point2(0.5, 0.5)).floor();
parent_xform.columns[2] = (parent_xform.columns[2] + Point2(0.5, 0.5)).floor();
}

final_xform = parent_xform * self_xform;
Expand Down

0 comments on commit 8d3e9aa

Please sign in to comment.