Attention une mise à jour du serveur va être effectuée le vendredi 16 avril entre 12h et 12h30. Cette mise à jour va générer une interruption du service de quelques minutes.

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 @@
#include "MatrixWindow.hpp"
#define BACKGROUND_COLOR_R 0.2f
#define BACKGROUND_COLOR_G 0.2f
#define BACKGROUND_COLOR_B 0.2f
#define BACKGROUND_COLOR_R 0.9f
#define BACKGROUND_COLOR_G 0.9f
#define BACKGROUND_COLOR_B 0.9f
/* Helpers */
static void drawSquare(GLfloat x, GLfloat y, GLfloat dx, GLfloat dy, GLfloat r, GLfloat g, GLfloat b)
......@@ -139,8 +139,13 @@ void MatrixGLWidget::paintGL()
{
GLfloat grey = m_zooming->getColor(i, j);
if (grey != 0.f) {
drawSquare(i, j, 1, 1, grey, grey, grey);
if (grey != 1.f) {
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