Commit cad67012 authored by Mathieu Faverge's avatar Mathieu Faverge

Better drawing of the color, and don't draw empty pixels

parent ed7529b2
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
#include "MatrixWindow.hpp" #include "MatrixWindow.hpp"
#define BACKGROUND_COLOR_R 0.2f #define BACKGROUND_COLOR_R 0.9f
#define BACKGROUND_COLOR_G 0.2f #define BACKGROUND_COLOR_G 0.9f
#define BACKGROUND_COLOR_B 0.2f #define BACKGROUND_COLOR_B 0.9f
/* Helpers */ /* Helpers */
static void drawSquare(GLfloat x, GLfloat y, GLfloat dx, GLfloat dy, GLfloat r, GLfloat g, GLfloat b) static void drawSquare(GLfloat x, GLfloat y, GLfloat dx, GLfloat dy, GLfloat r, GLfloat g, GLfloat b)
...@@ -139,8 +139,13 @@ void MatrixGLWidget::paintGL() ...@@ -139,8 +139,13 @@ void MatrixGLWidget::paintGL()
{ {
GLfloat grey = m_zooming->getColor(i, j); GLfloat grey = m_zooming->getColor(i, j);
if (grey != 0.f) { if (grey != 1.f) {
drawSquare(i, j, 1, 1, grey, grey, grey); if (grey != 0.f) {
drawSquare(i, j, 1, 1, 0., 0., grey);
}
else {
drawSquare(i, j, 1, 1, grey, grey, grey);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment