Skip to content

Commit

Permalink
Fix edges of grid in automap
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Oct 3, 2024
1 parent 709eec6 commit 1c14ba0
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/am_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,11 +1438,14 @@ static mline_t AM_DoNotRotateLine(mline_t mline)
//
static void AM_DrawGrid(void)
{
const fixed_t minlen = (fixed_t)sqrt((double)m_w * m_w + (double)m_h * m_h);
const fixed_t startx = m_x - (minlen - m_w) / 2;
const fixed_t starty = m_y - (minlen - m_h) / 2;
const fixed_t endx = startx + minlen;
const fixed_t endy = starty + minlen;
fixed_t minlen = (fixed_t)sqrt((double)m_w * m_w + (double)m_h * m_h);
fixed_t startx = m_x - (minlen - m_w) / 2;
fixed_t starty = m_y - (minlen - m_h) / 2;
fixed_t endx = startx + minlen;
fixed_t endy = starty + minlen;

starty += starty * 6 / 5;
endy += endy * 6 / 5;

// Draw vertical gridlines
for (fixed_t x = startx - ((startx - (bmaporgx >> FRACTOMAPBITS)) % gridwidth); x < endx; x += gridwidth)
Expand Down

0 comments on commit 1c14ba0

Please sign in to comment.