mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-05 23:07:42 -05:00
Revert "Fix #100536: Control set_position resizes offsets/anchors"
This reverts commit ca57fe1db4.
This commit is contained in:
@@ -1096,38 +1096,6 @@ TEST_CASE("[SceneTree][Control] Anchoring") {
|
||||
memdelete(test_control);
|
||||
}
|
||||
|
||||
TEST_CASE("[SceneTree][Control] Set position does not cause size side-effects") {
|
||||
Control *test_control = memnew(Control);
|
||||
test_control->set_size(Size2(1, 1));
|
||||
test_control->set_custom_minimum_size(Size2(2, 2));
|
||||
Window *root = SceneTree::get_singleton()->get_root();
|
||||
root->add_child(test_control);
|
||||
|
||||
SUBCASE("Shrinks after setting position and smaller custom minimum size (without keeping offsets)") {
|
||||
test_control->set_position(Point2(10, 10), false);
|
||||
SceneTree::get_singleton()->process(0);
|
||||
|
||||
test_control->set_custom_minimum_size(Size2(0, 0));
|
||||
SceneTree::get_singleton()->process(0);
|
||||
CHECK_MESSAGE(
|
||||
test_control->get_size().is_equal_approx(Vector2(1, 1)),
|
||||
"Should shrink to original size after setting a smaller custom minimum size.");
|
||||
}
|
||||
|
||||
SUBCASE("Shrinks after setting position and smaller custom minimum size (while keeping offsets)") {
|
||||
test_control->set_position(Point2(10, 10), true);
|
||||
SceneTree::get_singleton()->process(0);
|
||||
|
||||
test_control->set_custom_minimum_size(Size2(0, 0));
|
||||
SceneTree::get_singleton()->process(0);
|
||||
CHECK_MESSAGE(
|
||||
test_control->get_size().is_equal_approx(Vector2(1, 1)),
|
||||
"Should shrink to original size after setting a smaller custom minimum size.");
|
||||
}
|
||||
|
||||
memdelete(test_control);
|
||||
}
|
||||
|
||||
TEST_CASE("[SceneTree][Control] Custom minimum size") {
|
||||
Control *test_control = memnew(Control);
|
||||
test_control->set_custom_minimum_size(Size2(4, 2));
|
||||
|
||||
Reference in New Issue
Block a user