浏览代码

Fix control node transform animation jitter with pivot offset

The workaround for moving the pivot is not needed anymore, in fact it causes all transforms applied to control nodes to jitter while animating (if a pivot offset is set).

This can be observed via AnimationPlayer and Tween.

The fix is to remove the obsolete workaround that causes this bug.

Fixes #28804

(cherry picked from commit dfb7d46a2aaf9bef2c7dd067e699e70291062fb6)
Georg Wacker 5 年之前
父节点
当前提交
15315f118c
共有 1 个文件被更改,包括 0 次插入5 次删除
  1. 0 5
      scene/gui/control.cpp

+ 0 - 5
scene/gui/control.cpp

@@ -462,11 +462,6 @@ void Control::_update_canvas_item_transform() {
 	Transform2D xform = _get_internal_transform();
 	xform[2] += get_position();
 
-	// We use a little workaround to avoid flickering when moving the pivot with _edit_set_pivot()
-	if (is_inside_tree() && Math::abs(Math::sin(data.rotation * 4.0f)) < 0.00001f && get_viewport()->is_snap_controls_to_pixels_enabled()) {
-		xform[2] = xform[2].round();
-	}
-
 	VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), xform);
 }