mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Revert backport of 2D transform and camera snapping options
More work is needed to make sure that those options actually solve users' issues, so we prefer to remove the options for 3.2.4 and revisit for a future release.
This commit is contained in:
@@ -99,9 +99,6 @@ void VisualServerCanvas::_render_canvas_item(Item *p_canvas_item, const Transfor
|
||||
|
||||
Rect2 rect = ci->get_rect();
|
||||
Transform2D xform = ci->xform;
|
||||
if (snap_2d_transforms) {
|
||||
xform.elements[2] = xform.elements[2].round();
|
||||
}
|
||||
xform = p_transform * xform;
|
||||
|
||||
Rect2 global_rect = xform.xform(rect);
|
||||
@@ -1484,7 +1481,6 @@ VisualServerCanvas::VisualServerCanvas() {
|
||||
z_last_list = (RasterizerCanvas::Item **)memalloc(z_range * sizeof(RasterizerCanvas::Item *));
|
||||
|
||||
disable_scale = false;
|
||||
snap_2d_transforms = Engine::get_singleton()->get_snap_2d_transforms();
|
||||
}
|
||||
|
||||
VisualServerCanvas::~VisualServerCanvas() {
|
||||
|
||||
@@ -158,7 +158,6 @@ public:
|
||||
RID_Owner<RasterizerCanvas::Light> canvas_light_owner;
|
||||
|
||||
bool disable_scale;
|
||||
bool snap_2d_transforms;
|
||||
|
||||
private:
|
||||
void _render_canvas_item_tree(Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, RasterizerCanvas::Light *p_lights);
|
||||
|
||||
@@ -41,22 +41,14 @@ static Transform2D _canvas_get_transform(VisualServerViewport::Viewport *p_viewp
|
||||
|
||||
float scale = 1.0;
|
||||
|
||||
bool snap = Engine::get_singleton()->get_snap_2d_viewports();
|
||||
|
||||
if (p_viewport->canvas_map.has(p_canvas->parent)) {
|
||||
|
||||
Transform2D c_xform = p_viewport->canvas_map[p_canvas->parent].transform;
|
||||
if (snap) {
|
||||
c_xform.elements[2] = c_xform.elements[2].round();
|
||||
}
|
||||
xf = xf * c_xform;
|
||||
scale = p_canvas->parent_scale;
|
||||
}
|
||||
|
||||
Transform2D c_xform = p_canvas_data->transform;
|
||||
if (snap) {
|
||||
c_xform.elements[2] = c_xform.elements[2].round();
|
||||
}
|
||||
xf = xf * c_xform;
|
||||
|
||||
if (scale != 1.0 && !VSG::canvas->disable_scale) {
|
||||
|
||||
Reference in New Issue
Block a user