Navigation Menu

Skip to content

Commit

Permalink
#5455: Adjust grid center to be located at the scene's origin
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Jan 24, 2021
1 parent 1297b75 commit b0e44f3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libs/wxutil/preview/RenderPreview.cpp
Expand Up @@ -742,6 +742,11 @@ void RenderPreview::drawGrid()
glLineWidth(1);
glColor3f(0.7f, 0.7f, 0.7f);

glPushMatrix();

auto sceneCenter = getSceneBounds().getOrigin();
glTranslated(sceneCenter.x(), sceneCenter.y(), sceneCenter.z());

glBegin(GL_LINES);

for (float x = -GRID_MAX_DIM; x < GRID_MAX_DIM; x += GRID_STEP)
Expand All @@ -760,6 +765,8 @@ void RenderPreview::drawGrid()
}

glEnd();

glPopMatrix();
}

void RenderPreview::drawTime()
Expand Down

0 comments on commit b0e44f3

Please sign in to comment.