Skip to content

Commit

Permalink
small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Jan 2, 2024
1 parent be63cd8 commit fa0cf54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/client/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,10 @@ void Creature::drawInformation(const MapPosInfo& mapRect, const Point& dest, boo
}

// distance them
uint8_t offset = 12;
if (isLocalPlayer())
offset *= 2;

offset *= mapRect.scaleFactor;
uint8_t offset = 12 * mapRect.scaleFactor;
if (isLocalPlayer()) {
offset *= 2 * mapRect.scaleFactor;
}

if (textRect.top() == parentRect.top())
backgroundRect.moveTop(textRect.top() + offset);
Expand Down
3 changes: 2 additions & 1 deletion src/client/mapview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ void MapView::updateRect(const Rect& rect) {
m_posInfo.drawOffset = m_posInfo.srcRect.topLeft();
m_posInfo.horizontalStretchFactor = rect.width() / static_cast<float>(m_posInfo.srcRect.width());
m_posInfo.verticalStretchFactor = rect.height() / static_cast<float>(m_posInfo.srcRect.height());
m_posInfo.scaleFactor = g_drawPool.getScaleFactor();

const auto& mousePos = getPosition(g_window.getMousePosition());
if (mousePos != m_mousePosition)
Expand All @@ -427,6 +426,8 @@ void MapView::updateGeometry(const Size& visibleDimension)

m_pool->setScaleFactor(scaleFactor);

m_posInfo.scaleFactor = scaleFactor;

const uint16_t tileSize = g_gameConfig.getSpriteSize() * m_pool->getScaleFactor();
const auto& drawDimension = visibleDimension + 3;
const auto& bufferSize = drawDimension * tileSize;
Expand Down

0 comments on commit fa0cf54

Please sign in to comment.