File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -3230,14 +3230,19 @@ void PopupMenu::_pre_popup() {
32303230 }
32313231 real_t popup_scale = MIN (scale.x , scale.y );
32323232 set_content_scale_factor (popup_scale);
3233- Size2 minsize = get_contents_minimum_size () * popup_scale;
3234- minsize.height = Math::ceil (minsize.height ); // Ensures enough height at fractional content scales to prevent the v_scroll_bar from showing.
3235- real_t max_h = get_max_size ().height ;
3236- if (max_h > 0 ) {
3237- minsize.height = MIN (minsize.height , max_h);
3233+ if (is_wrapping_controls ()) {
3234+ Size2 minsize = get_contents_minimum_size () * popup_scale;
3235+ Size2 maxsize = get_max_size ();
3236+ if (maxsize.height > 0 ) {
3237+ minsize.height = MIN (minsize.height , maxsize.height );
3238+ }
3239+ if (maxsize.width > 0 ) {
3240+ minsize.width = MIN (minsize.width , maxsize.width );
3241+ }
3242+ minsize.height = Math::ceil (minsize.height ); // Ensures enough height at fractional content scales to prevent the v_scroll_bar from showing.
3243+ set_min_size (minsize); // `height` is truncated here by the cast to Size2i for Window.min_size.
3244+ reset_size (); // Shrinkwraps to min size.
32383245 }
3239- set_min_size (minsize); // `height` is truncated here by the cast to Size2i for Window.min_size.
3240- reset_size (); // Shrinkwraps to min size.
32413246}
32423247
32433248void PopupMenu::set_visible (bool p_visible) {
You can’t perform that action at this time.
0 commit comments