Receiving NaN through coordinates projections 56/13956/1
Bruno JOFRET [Fri, 7 Mar 2014 17:39:20 +0000 (18:39 +0100)]
Change-Id: I1f4a5a96a3919924de4a4ba581e27e5c9a7ccb94

scilab/modules/scirenderer/src/org/scilab/forge/scirenderer/ruler/RulerDrawer.java

index 4576034..f911d45 100644 (file)
@@ -349,7 +349,13 @@ public class RulerDrawer {
                 for (double value : ticks) {
                     Texture sprite = computeSprite(value, format);
                     Vector3d windowPosition = canvasProjection.project(rulerModel.getPosition(value));
-
+                    
+                    // X != X means NaN so we are not able to project coordinates
+                    // return basic format
+                    if (windowPosition.getX() != windowPosition.getX()) {
+                        return format;
+                    }
+                    
                     Dimension textureSize = computeSpriteDimension(value);
 
                     Vector3d delta = projectCenterToEdge(textureSize, windowTicksDelta);