From 3aebaa0298237a24e8c17e6bd009613958ba8ca5 Mon Sep 17 00:00:00 2001
From: Thibault Soucarre <thibault.soucarre@inria.fr>
Date: Thu, 31 Jul 2014 07:56:36 +0000
Subject: [PATCH] using float instead of double for Element_pos

---
 src/common/common.hpp           | 2 +-
 src/render/Render_alternate.cpp | 2 +-
 src/render/render_stats_svg.hpp | 4 ++--
 src/render/vbo.cpp              | 2 +-
 src/trace/DrawTrace.hpp         | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/common/common.hpp b/src/common/common.hpp
index a1ce12dd..282a6e6d 100644
--- a/src/common/common.hpp
+++ b/src/common/common.hpp
@@ -92,7 +92,7 @@ typedef long Element_count;
 /*!
  * \brief Unity for variables of position of a element in the display such as height, abscissa...
  */
-typedef double Element_pos;
+typedef float Element_pos;
 
 /*!
  * \brief Unity for colors
diff --git a/src/render/Render_alternate.cpp b/src/render/Render_alternate.cpp
index c376faa0..de01dafb 100644
--- a/src/render/Render_alternate.cpp
+++ b/src/render/Render_alternate.cpp
@@ -146,7 +146,7 @@ void  Render_alternate::resizeGL(int width, int height) {
     if(_state == DRAWING_STATE_WAITING)
         _projection = glm::ortho(-50, 50, -50, 50);//, 0, 1);
     else if(_state == DRAWING_STATE_DRAWING)
-        _projection = glm::ortho(0., Info::Render::width, 0., Info::Render::height, 0., 100.);
+        _projection = glm::ortho(0.f, Info::Render::width, 0.f, Info::Render::height, 0.f, 100.f);
     else{
      message << tr("Undefined value for the drawing state attribute - Render area").toStdString() << Message::ende;
      }
diff --git a/src/render/render_stats_svg.hpp b/src/render/render_stats_svg.hpp
index 397f9727..16b14368 100644
--- a/src/render/render_stats_svg.hpp
+++ b/src/render/render_stats_svg.hpp
@@ -72,8 +72,8 @@ private:
     std::ofstream _svg_file;
     std::string   _filename;
 
-    double _y_min;
-    double _y_max;
+    Element_pos _y_min;
+    Element_pos _y_max;
     /*!
      * \brief Contains container text coordinates.
      */
diff --git a/src/render/vbo.cpp b/src/render/vbo.cpp
index 798e8289..d37ad6a0 100644
--- a/src/render/vbo.cpp
+++ b/src/render/vbo.cpp
@@ -156,7 +156,7 @@ void Vbo::config(){
         //Select VBO
         glBindBuffer(GL_ARRAY_BUFFER, _vboID);
         //Send vertex
-        glVertexAttribPointer(0, 2, GL_DOUBLE, GL_FALSE, 0, BUFFER_OFFSET(0));
+        glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0));
         glEnableVertexAttribArray(0);
         //Send colors
         if(colors_size>0){
diff --git a/src/trace/DrawTrace.hpp b/src/trace/DrawTrace.hpp
index fa0c559c..a6615c8e 100644
--- a/src/trace/DrawTrace.hpp
+++ b/src/trace/DrawTrace.hpp
@@ -610,7 +610,7 @@ public:
         const Variable *variable;
 
         // find container needs to know the position of each container
-        double yr = y;
+        Element_pos yr = y;
         const Container::Vector *root_containers = trace->get_view_root_containers();
         if(root_containers->empty())root_containers= trace->get_root_containers();
         if (!root_containers->empty())
@@ -751,7 +751,7 @@ public:
         }
     }
 
-    const Container *search_container_by_position(const Container *container, double &y) {
+    const Container *search_container_by_position(const Container *container, Element_pos &y) {
         const Container *result;
         // Search if the result is a descendant
         const Container::Vector *children = container->get_view_children();//we want to display only children meant to be displayed
-- 
GitLab