Skip to content

Commit

Permalink
Fix item info part of crafting ui in wide mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Qrox committed Apr 17, 2020
1 parent e90cc91 commit 60ea359
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/crafting_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ const recipe *select_crafting_recipe( int &batch_size )

w_head = catacurses::newwin( headHeight, width, point( wStart, 0 ) );
w_subhead = catacurses::newwin( subHeadHeight, width, point( wStart, 3 ) );
w_data = catacurses::newwin( dataHeight, width, point( wStart,
headHeight + subHeadHeight ) );

if( isWide ) {
item_info_width = width - FULL_SCREEN_WIDTH - 2;
Expand All @@ -227,9 +229,6 @@ const recipe *select_crafting_recipe( int &batch_size )
w_iteminfo = {};
}

w_data = catacurses::newwin( dataHeight, width - item_info_width,
point( wStart, headHeight + subHeadHeight ) );

ui.position( point( wStart, 0 ), point( width, TERMY ) );
} );
ui.mark_resize();
Expand Down Expand Up @@ -571,6 +570,7 @@ const recipe *select_crafting_recipe( int &batch_size )
}

draw_scrollbar( w_data, line, dataLines, recmax, point_zero );
wrefresh( w_data );

if( isWide && !current.empty() ) {
item_info_data data = item_info_data_from_recipe( current[line], count, item_info_scroll );
Expand All @@ -584,8 +584,8 @@ const recipe *select_crafting_recipe( int &batch_size )
if( cursor_pos ) {
// place the cursor at the selected item name as expected by screen readers
wmove( w_data, cursor_pos.value() );
wrefresh( w_data );
}
wrefresh( w_data );
} );

do {
Expand Down

0 comments on commit 60ea359

Please sign in to comment.