diff options
Diffstat (limited to 'src/Gui/RenderArea.cpp')
-rw-r--r-- | src/Gui/RenderArea.cpp | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/Gui/RenderArea.cpp b/src/Gui/RenderArea.cpp index 7aa2745..6b6b8ed 100644 --- a/src/Gui/RenderArea.cpp +++ b/src/Gui/RenderArea.cpp @@ -102,10 +102,8 @@ bool RenderArea::onExposeEvent(GdkEventExpose*) { glScalef(scale, scale, 1); glTranslatef(-xCenter, -yCenter, 0); - drawGrid(); - if(view) - view->render(); + view->render(this); glMatrixMode(GL_MODELVIEW); glPopMatrix(); @@ -219,39 +217,5 @@ void RenderArea::updateScrolling() { queue_draw(); } -void RenderArea::drawGrid() { - float depth = 1.25f + 0.04f*zoomLevel; - float depth2 = std::floor(depth); - float step = std::pow(0.1f, depth2); - float f; - int i; - float x1 = xCenter-getViewWidth()/2, y1 = yCenter-getViewHeight()/2; - float x2 = xCenter+getViewWidth()/2, y2 = yCenter+getViewHeight()/2; - - - glLineWidth(1.0f); - - glBegin(GL_LINES); - - for(i = 0; 0.4f*(depth-depth2+i-1) < 0.5f; i++) { - f = std::min(0.4f*(depth-depth2+i), 0.5f); - glColor3f(f, f, f); - - for(f = x1 - std::fmod(x1, step); f <= x2; f+=step) { - glVertex2f(f, y1); - glVertex2f(f, y2); - } - - for(f = y1 - std::fmod(y1, step); f <= y2; f+=step) { - glVertex2f(x1, f); - glVertex2f(x2, f); - } - - step *= 10; - } - - glEnd(); -} - } } |