You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Replace FALLTHROUGH macro by C++17 [[fallthrough]]
This attribute is now part of the standard we target so we no longer need compiler-specific hacks. Also enables -Wimplicit-fallthrough for Clang now that we can properly support it. It's already on by default for GCC's -Wextra. Fixes new warnings raised by Clang's -Wimplicit-fallthrough.
This commit is contained in:
@@ -3100,7 +3100,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) {
|
||||
case DRAG_TOP_LEFT:
|
||||
case DRAG_BOTTOM_LEFT:
|
||||
_draw_margin_at_position(control->get_size().width, parent_transform.xform(Vector2((node_pos_in_parent[0] + node_pos_in_parent[2]) / 2, node_pos_in_parent[3])) + Vector2(0, 5), MARGIN_BOTTOM);
|
||||
FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DRAG_MOVE:
|
||||
start = Vector2(node_pos_in_parent[0], Math::lerp(node_pos_in_parent[1], node_pos_in_parent[3], ratio));
|
||||
end = start - Vector2(control->get_margin(MARGIN_LEFT), 0);
|
||||
@@ -3115,7 +3115,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) {
|
||||
case DRAG_TOP_RIGHT:
|
||||
case DRAG_BOTTOM_RIGHT:
|
||||
_draw_margin_at_position(control->get_size().width, parent_transform.xform(Vector2((node_pos_in_parent[0] + node_pos_in_parent[2]) / 2, node_pos_in_parent[3])) + Vector2(0, 5), MARGIN_BOTTOM);
|
||||
FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DRAG_MOVE:
|
||||
start = Vector2(node_pos_in_parent[2], Math::lerp(node_pos_in_parent[3], node_pos_in_parent[1], ratio));
|
||||
end = start - Vector2(control->get_margin(MARGIN_RIGHT), 0);
|
||||
@@ -3130,7 +3130,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) {
|
||||
case DRAG_TOP_LEFT:
|
||||
case DRAG_TOP_RIGHT:
|
||||
_draw_margin_at_position(control->get_size().height, parent_transform.xform(Vector2(node_pos_in_parent[2], (node_pos_in_parent[1] + node_pos_in_parent[3]) / 2)) + Vector2(5, 0), MARGIN_RIGHT);
|
||||
FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DRAG_MOVE:
|
||||
start = Vector2(Math::lerp(node_pos_in_parent[0], node_pos_in_parent[2], ratio), node_pos_in_parent[1]);
|
||||
end = start - Vector2(0, control->get_margin(MARGIN_TOP));
|
||||
@@ -3145,7 +3145,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) {
|
||||
case DRAG_BOTTOM_LEFT:
|
||||
case DRAG_BOTTOM_RIGHT:
|
||||
_draw_margin_at_position(control->get_size().height, parent_transform.xform(Vector2(node_pos_in_parent[2], (node_pos_in_parent[1] + node_pos_in_parent[3]) / 2) + Vector2(5, 0)), MARGIN_RIGHT);
|
||||
FALLTHROUGH;
|
||||
[[fallthrough]];
|
||||
case DRAG_MOVE:
|
||||
start = Vector2(Math::lerp(node_pos_in_parent[2], node_pos_in_parent[0], ratio), node_pos_in_parent[3]);
|
||||
end = start - Vector2(0, control->get_margin(MARGIN_BOTTOM));
|
||||
|
||||
Reference in New Issue
Block a user