File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -276,6 +276,7 @@ Size2 PopupMenu::_get_contents_minimum_size() const {
276276 }
277277 }
278278
279+ minsize.height = Math::ceil (minsize.height ); // Ensures enough height at fractional content scales to prevent the v_scroll_bar from showing.
279280 return minsize;
280281}
281282
@@ -2832,9 +2833,9 @@ void PopupMenu::popup(const Rect2i &p_bounds) {
28322833 if (!is_embedded ()) {
28332834 float win_scale = get_parent_visible_window ()->get_content_scale_factor ();
28342835 set_content_scale_factor (win_scale);
2835- Size2 minsize = get_contents_minimum_size ();
2836- minsize.height += 0.5 * win_scale ; // Ensures enough height at fractional content scales to prevent the v_scroll_bar from showing.
2837- set_min_size (minsize * win_scale);
2836+ Size2 minsize = get_contents_minimum_size () * win_scale ;
2837+ minsize.height = Math::ceil (minsize. height ) ; // Ensures enough height at fractional content scales to prevent the v_scroll_bar from showing.
2838+ set_min_size (minsize); // `height` is truncated here by the cast to Size2i for Window.min_size.
28382839 set_size (Vector2 (0 , 0 )); // Shrinkwraps to min size.
28392840 }
28402841 Popup::popup (p_bounds);
You can’t perform that action at this time.
0 commit comments