Skip to content

Commit

Permalink
fix #477
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Mar 16, 2023
1 parent 2e5d2b6 commit 8142b58
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/client/mapview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,13 @@ void MapView::updateGeometry(const Size& visibleDimension)
m_virtualCenterOffset = (drawDimension / 2 - Size(1)).toPoint();
m_rectDimension = { 0, 0, bufferSize };

if (m_lightView->isEnabled()) m_lightView->resize(m_drawDimension, tileSize);
if (m_lightView->isEnabled()) {
Size lightSize = g_map.getAwareRange().dimension();
if (drawDimension > lightSize)
lightSize = drawDimension;

m_lightView->resize(lightSize, tileSize);
}
g_mainDispatcher.addEvent([=, this]() {
m_pool->getFrameBuffer()->resize(bufferSize);
});
Expand Down
2 changes: 2 additions & 0 deletions src/client/mapview.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ struct AwareRange

uint8_t horizontal() const { return left + right + 1; }
uint8_t vertical() const { return top + bottom + 1; }

Size dimension() const { return { left * 2 + 1 , top * 2 + 1 }; }
};

struct MapPosInfo
Expand Down

0 comments on commit 8142b58

Please sign in to comment.