Merge pull request #77625 from anvilfolk/itgrowwws

Increase vertical size of `CurveEdit` when `Inspector` widens
This commit is contained in:
Yuri Sizov
2023-08-03 22:37:33 +02:00
2 changed files with 6 additions and 1 deletions

View File

@ -105,7 +105,7 @@ void CurveEdit::set_snap_count(int p_snap_count) {
} }
Size2 CurveEdit::get_minimum_size() const { 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) { void CurveEdit::_notification(int p_what) {
@ -986,6 +986,9 @@ void CurveEditor::_notification(int p_what) {
snap_count_edit->set_value(curve->get_meta("_snap_count", DEFAULT_SNAP)); snap_count_edit->set_value(curve->get_meta("_snap_count", DEFAULT_SNAP));
} }
} break; } break;
case NOTIFICATION_RESIZED:
curve_editor_rect->update_minimum_size();
break;
} }
} }

View File

@ -104,6 +104,8 @@ private:
void _redraw(); void _redraw();
private: private:
const float ASPECT_RATIO = 6.f / 13.f;
Transform2D _world_to_view; Transform2D _world_to_view;
Ref<Curve> curve; Ref<Curve> curve;