Bug 12374 fixed: unexpected mark was drawn with xsegs 69/10769/2
Calixte DENIZET [Mon, 11 Mar 2013 10:21:13 +0000 (11:21 +0100)]
Change-Id: I13a3919501063226d237f6f2c39ca3a242d1889d

scilab/CHANGES_5.4.X
scilab/modules/graphic_objects/src/java/org/scilab/modules/graphic_objects/contouredObject/Mark.java
scilab/modules/renderer/src/java/org/scilab/modules/renderer/JoGLView/DrawerVisitor.java

index fa2bf9e..fba52cb 100644 (file)
@@ -519,6 +519,8 @@ Bug fixes
 
 * Bug #12373 fixed - pmodulo(n,m<0) returned a negative result.
 
+* Bug #12374 fixed - Unexpected mark was drawn with xsegs.
+
 * Bug #12377 fixed - chepol was located in the wrong help section
                      (now in polynomial).
 
index 79f21d1..291befe 100644 (file)
@@ -79,6 +79,7 @@ public class Mark {
     public Mark(Mark mark) {
         mode = mark.mode;
         style = mark.style;
+        size = mark.size;
         markSizeUnit = mark.markSizeUnit;
         foreground = mark.foreground;
         background = mark.background;
index e418cfa..004e892 100644 (file)
@@ -803,7 +803,10 @@ public class DrawerVisitor implements Visitor, Drawer, GraphicView {
                 if (segs.getMarkMode()) {
                     Texture texture = markManager.getMarkSprite(segs.getIdentifier(), segs.getArrows().get(0).getMark(), colorMap);
                     ElementsBuffer positions = dataManager.getVertexBuffer(segs.getIdentifier());
+                    // Take only into account start-end of segs and not the arrow head.
+                    positions.getData().limit(segs.getNumberArrows() * 2 * 4);
                     drawingTools.draw(texture, AnchorPosition.CENTER, positions);
+                    positions.getData().limit(positions.getData().capacity());
                 }
 
                 /* Draw the arrows */