Skip to content

Commit

Permalink
Fix view world borders when it is called from editor when screen heig…
Browse files Browse the repository at this point in the history
…ht is 480
  • Loading branch information
Districh-ru committed Jan 20, 2025
1 parent f25ff7f commit 1cf1399
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/fheroes2/kingdom/view_world.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,7 @@ void ViewWorld::ViewWorldWindow( const int32_t color, const ViewWorldMode mode,
renderProcessor.stopColorCycling();

// Creates fixed radar on top-right, suitable for the View World window
Interface::Radar radar( interface.getRadar(), fheroes2::Display::instance() );
Interface::Radar radar( interface.getRadar(), display );

Interface::GameArea & gameArea = interface.getGameArea();
const fheroes2::Rect & worldMapROI = gameArea.GetVisibleTileROI();
Expand Down Expand Up @@ -654,6 +654,22 @@ void ViewWorld::ViewWorldWindow( const int32_t color, const ViewWorldMode mode,
if ( !interface.isEditor() ) {
DrawObjectsIcons( color, mode, cache );
}
else if ( display.height() == fheroes2::Display::DEFAULT_HEIGHT ) {
// Fix borders for Editor if screen height is 480 pixels.
const fheroes2::Sprite & borderSprite = fheroes2::AGG::GetICN( isEvilInterface ? ICN::ADVBORDE : ICN::ADVBORD, 0 );

const int32_t offsetX = 480;
const int32_t stepY = 304;
fheroes2::Rect borderRoi( display.width() - borderSprite.width() + offsetX, 160, 144, 17 );

fheroes2::Copy( borderSprite, offsetX, borderRoi.y, display, borderRoi );
borderRoi.y += stepY;
fheroes2::Copy( borderSprite, offsetX, borderRoi.y, display, borderRoi );

borderRoi.y -= stepY;
borderRoi.height += stepY;
display.updateNextRenderRoi( borderRoi );
}

// We need to draw interface borders only if game interface is turned off on Adventure map.
if ( isHideInterface ) {
Expand Down

0 comments on commit 1cf1399

Please sign in to comment.