diff options
author | Alvin Wong <alvinhochun@gmail.com> | 2024-06-30 23:51:13 +0800 |
---|---|---|
committer | Alvin Wong <alvinhochun@gmail.com> | 2024-09-23 20:34:11 +0800 |
commit | 1bd66af54ce86d5882830ce5170cdfeb914bb873 (patch) | |
tree | 94db18d8268203ba7a6e3a17551a8a3278c8e877 /core/math/convex_hull.cpp | |
parent | d5aadc38b459762fa74850777edb2ec8f6a02c16 (diff) | |
download | redot-engine-1bd66af54ce86d5882830ce5170cdfeb914bb873.tar.gz |
Apply snap 2D transforms to pixel to viewport
We shall not leave the viewport transform to be rounded by the code for
rounding canvas items. Since the viewport transform is inverse to the
camera transform, we get incorrect rounding at the halfway point that
misaligns the viewport and the canvas item which the camera is
following.
Instead, reintroduce viewport rounding, but do it in a way that matches
the rounding of canvas items. Also take into account the half-pixel
offset of the centre point when viewport dimension is not divisible by
two. For `CanvasLayer`s that follows viewport, take into account the
scale when rounding. Overall this should work better compared to the
rounding in Godot 4.2 (and earlier).
Diffstat (limited to 'core/math/convex_hull.cpp')
0 files changed, 0 insertions, 0 deletions