Skip to content

Commit

Permalink
Fix rounding issue of hud dpi on some machines
Browse files Browse the repository at this point in the history
  • Loading branch information
sapier authored and sapier committed Apr 27, 2014
1 parent 0d6e4ef commit 65016c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hud.cpp
Expand Up @@ -49,7 +49,7 @@ Hud::Hud(video::IVideoDriver *driver, scene::ISceneManager* smgr,

m_screensize = v2u32(0, 0);
m_displaycenter = v2s32(0, 0);
m_hotbar_imagesize = HOTBAR_IMAGE_SIZE * porting::getDisplayDensity();
m_hotbar_imagesize = floor(HOTBAR_IMAGE_SIZE * porting::getDisplayDensity() + 0.5);
m_padding = m_hotbar_imagesize / 12;

const video::SColor hbar_color(255, 255, 255, 255);
Expand Down Expand Up @@ -436,7 +436,7 @@ void Hud::drawSelectionBoxes(std::vector<aabb3f> &hilightboxes) {

void Hud::resizeHotbar() {
if (m_screensize != porting::getWindowSize()) {
m_hotbar_imagesize = porting::getDisplayDensity() * HOTBAR_IMAGE_SIZE;
m_hotbar_imagesize = floor(HOTBAR_IMAGE_SIZE * porting::getDisplayDensity() + 0.5);
m_padding = m_hotbar_imagesize / 12;
m_screensize = porting::getWindowSize();
m_displaycenter = v2s32(m_screensize.X/2,m_screensize.Y/2);
Expand Down

0 comments on commit 65016c8

Please sign in to comment.