From e29ac2b11ac6fdd11fda59cef4ea6274b079efb3 Mon Sep 17 00:00:00 2001 From: Caio SOUZA Date: Thu, 5 May 2016 13:51:08 -0300 Subject: [PATCH] * Bug #14540 fixed - Datatips did not clip outside axes bounds Fix datatip rendering when it's out ou view box Change-Id: Ia29fa7a356b2631b435e4aa3cb01711c752a4ea9 --- scilab/CHANGES | 4 +++- .../modules/renderer/JoGLView/DrawerVisitor.java | 24 +++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/scilab/CHANGES b/scilab/CHANGES index c9676f0..df8328d 100644 --- a/scilab/CHANGES +++ b/scilab/CHANGES @@ -467,7 +467,9 @@ In 6.0.0: * Bug #14500 fixed - Operator ".^" was broken for sparse matrices. -* Bug #14524 fixed - Numercic locales were not set to standard "C" by default at scilab startup +* Bug #14540 fixed - Datatips did not clip outside axes bounds + +* Bug #14524 fixed - Numeric locales were not set to standard "C" by default at scilab startup In 6.0.0 beta-1: diff --git a/scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/DrawerVisitor.java b/scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/DrawerVisitor.java index be5d6bf..4ca7209 100755 --- a/scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/DrawerVisitor.java +++ b/scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/DrawerVisitor.java @@ -936,14 +936,22 @@ public class DrawerVisitor implements Visitor, Drawer, GraphicView { if (datatip.isValid() && datatip.getVisible()) { axesDrawer.enableClipping(currentAxes, datatip.getClipProperty()); try { - if (datatip.getMarkMode()) { - /* TODO: appearance can be not-null */ - Texture texture = markManager.getMarkSprite(datatip, colorMap, null); - Vector3d markPos = DatatipTextDrawer.calculateAnchorPoint(datatip); - drawingTools.draw(texture, AnchorPosition.CENTER, markPos); - } - if (datatip.getTipLabelMode()) { - datatipTextDrawer.draw(drawingTools, colorMap, datatip); + Double[] box = currentAxes.getCorrectedBounds(); + Vector3d markPos = DatatipTextDrawer.calculateAnchorPoint(datatip); + Double x = markPos.getX(); + Double y = markPos.getY(); + Double z = markPos.getZ(); + if (x >= box[0] && x <= box[1] && + y >= box[2] && y <= box[3] && + z >= box[4] && z <= box[5]) { + if (datatip.getMarkMode()) { + /* TODO: appearance can be not-null */ + Texture texture = markManager.getMarkSprite(datatip, colorMap, null); + drawingTools.draw(texture, AnchorPosition.CENTER, markPos); + } + if (datatip.getTipLabelMode()) { + datatipTextDrawer.draw(drawingTools, colorMap, datatip); + } } } catch (SciRendererException e) { invalidate((Text)datatip, e); -- 1.7.9.5