Skip to content

Commit

Permalink
fix recent regression of CleverRaven#77191
Browse files Browse the repository at this point in the history
  • Loading branch information
db48x committed Oct 25, 2024
1 parent f633a1b commit 2936287
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,21 @@ void uilist::calc_data()
+ 2 * ( s.WindowPadding.x + s.WindowBorderSize );
calculated_bounds.h = calculated_menu_size.y + additional_height;

if( desired_bounds.has_value() ) {
cataimgui::bounds b = desired_bounds.value();
bool h_neg = b.h < 0.0f;
bool w_neg = b.w < 0.0f;
bool both_neg = h_neg && w_neg;
if( !both_neg ) {
if( h_neg ) {
desired_bounds->h = calculated_bounds.h;
}
if( w_neg ) {
desired_bounds->w = calculated_bounds.w;
}
}
}

if( longest_line_width > calculated_menu_size.x ) {
calculated_menu_size.x = longest_line_width;
calculated_label_width = calculated_menu_size.x - calculated_hotkey_width - padding -
Expand Down

0 comments on commit 2936287

Please sign in to comment.