|
@@ -2275,6 +2275,7 @@ void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) {
|
|
break;
|
|
break;
|
|
case DRAG_PAN:
|
|
case DRAG_PAN:
|
|
c = CURSOR_DRAG;
|
|
c = CURSOR_DRAG;
|
|
|
|
+ break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
@@ -2611,6 +2612,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) {
|
|
case DRAG_TOP_LEFT:
|
|
case DRAG_TOP_LEFT:
|
|
case DRAG_BOTTOM_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);
|
|
_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;
|
|
case DRAG_MOVE:
|
|
case DRAG_MOVE:
|
|
start = Vector2(node_pos_in_parent[0], Math::lerp(node_pos_in_parent[1], node_pos_in_parent[3], ratio));
|
|
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);
|
|
end = start - Vector2(control->get_margin(MARGIN_LEFT), 0);
|
|
@@ -2625,6 +2627,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) {
|
|
case DRAG_TOP_RIGHT:
|
|
case DRAG_TOP_RIGHT:
|
|
case DRAG_BOTTOM_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);
|
|
_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;
|
|
case DRAG_MOVE:
|
|
case DRAG_MOVE:
|
|
start = Vector2(node_pos_in_parent[2], Math::lerp(node_pos_in_parent[3], node_pos_in_parent[1], ratio));
|
|
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);
|
|
end = start - Vector2(control->get_margin(MARGIN_RIGHT), 0);
|
|
@@ -2639,6 +2642,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) {
|
|
case DRAG_TOP_LEFT:
|
|
case DRAG_TOP_LEFT:
|
|
case DRAG_TOP_RIGHT:
|
|
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);
|
|
_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;
|
|
case DRAG_MOVE:
|
|
case DRAG_MOVE:
|
|
start = Vector2(Math::lerp(node_pos_in_parent[0], node_pos_in_parent[2], ratio), node_pos_in_parent[1]);
|
|
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));
|
|
end = start - Vector2(0, control->get_margin(MARGIN_TOP));
|
|
@@ -2653,6 +2657,7 @@ void CanvasItemEditor::_draw_control_helpers(Control *control) {
|
|
case DRAG_BOTTOM_LEFT:
|
|
case DRAG_BOTTOM_LEFT:
|
|
case DRAG_BOTTOM_RIGHT:
|
|
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);
|
|
_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;
|
|
case DRAG_MOVE:
|
|
case DRAG_MOVE:
|
|
start = Vector2(Math::lerp(node_pos_in_parent[2], node_pos_in_parent[0], ratio), node_pos_in_parent[3]);
|
|
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));
|
|
end = start - Vector2(0, control->get_margin(MARGIN_BOTTOM));
|