Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase vertical size of CurveEdit when Inspector widens #77625

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion editor/plugins/curve_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void CurveEdit::set_snap_count(int p_snap_count) {
}

Size2 CurveEdit::get_minimum_size() const {
return Vector2(64, 135) * EDSCALE;
return Vector2(64, MAX(135, get_size().x * ASPECT_RATIO)) * EDSCALE;
}

void CurveEdit::_notification(int p_what) {
Expand Down Expand Up @@ -986,6 +986,9 @@ void CurveEditor::_notification(int p_what) {
snap_count_edit->set_value(curve->get_meta("_snap_count", DEFAULT_SNAP));
}
} break;
case NOTIFICATION_RESIZED:
curve_editor_rect->update_minimum_size();
break;
}
}

Expand Down
2 changes: 2 additions & 0 deletions editor/plugins/curve_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ class CurveEdit : public Control {
void _redraw();

private:
const float ASPECT_RATIO = 6.f / 13.f;

Transform2D _world_to_view;

Ref<Curve> curve;
Expand Down