Skip to content

Commit

Permalink
Revert "Merge pull request CleverRaven#72833 from katemonster33/imgui…
Browse files Browse the repository at this point in the history
…_screen_artifacts"

This reverts commit 046c7ce, reversing
changes made to 5dd5c2c.
this
  • Loading branch information
SurFlurer committed Aug 26, 2024
1 parent 23ea262 commit 6592d2a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/cata_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ class cataimgui::window_impl
ImVec2 imsize = ImGui::GetWindowSize();
imvec2_to_point( &impos, &catapos );
imvec2_to_point( &imsize, &catasize );
window_adaptor->position_absolute( catapos, catasize );
window_adaptor->position( catapos, catasize );
} );
window_adaptor->on_screen_resize( [this]( ui_adaptor & ) {
is_resized = true;
Expand Down
5 changes: 5 additions & 0 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3832,6 +3832,11 @@ input_event input_manager::get_input_event( const keyboard_mode preferred_keyboa
// we can skip screen update if `needupdate` is false to improve performance during mouse
// move events.
wnoutrefresh( catacurses::stdscr );
// This statement is required when the screen is made very small
if( ui_adaptor::has_imgui() ) {
needupdate = true;
}

if( needupdate ) {
refresh_display();
}
Expand Down
9 changes: 0 additions & 9 deletions src/ui_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,6 @@ void ui_adaptor::position( const point &topleft, const point &size )
ui_manager::invalidate( old_dimensions, false );
}

void ui_adaptor::position_absolute( const point &topleft, const point &size )
{
const rectangle<point> old_dimensions = dimensions;
// ensure position is updated before calling invalidate
dimensions = rectangle<point>( topleft, topleft + size );
invalidated = true;
ui_manager::invalidate( old_dimensions, false );
}

void ui_adaptor::on_redraw( const redraw_callback_t &fun )
{
redraw_cb = fun;
Expand Down
5 changes: 0 additions & 5 deletions src/ui_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,6 @@ class ui_adaptor
* and curses builds.
**/
void position( const point &topleft, const point &size );
/**
* like 'position', except topleft and size are given as
* pixels in tiled builds and console cells on curses builds
**/
void position_absolute( const point &topleft, const point &size );
/**
* Set redraw and resize callbacks. The resize callback should
* call `position` or `position_from_window` to set the size of the UI,
Expand Down

0 comments on commit 6592d2a

Please sign in to comment.