Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DrawImage always drawn above DrawLabel

    I need to draw a label on top of an image, but for some reason the DrawLabel is always drawn under the DrawImage instead of on top of it. If I try the same thing with a shape like DrawTriangle, then the DrawLabel does appear over the shape - but not when using DrawImage.

    I am using SmartGWT Pro version 4.0p built on Jan 5, 2014 (v9.0p_2014-01-05), using Firefox version 26.0.

    This can be reproduced by using the showcase example ShapeGallerySample, and replacing one of the shapes with a DrawImage. For example:

    Code:
    /* This works and label appears over the shape */
    
                    DrawTriangle drawTriangle = new DrawTriangle();  
                    drawTriangle.setDrawPane(drawPane);  
                    drawTriangle.setFillColor("#FF0000");
                    drawTriangle.setPoints(new Point(100,50),new Point(150,150),new Point(50,150));  
                    drawTriangle.draw();  
                      
                    DrawLabel triangleLabel = new DrawLabel();  
                    triangleLabel.setDrawPane(drawPane);  
                    triangleLabel.setLeft(50);  
                    triangleLabel.setTop(100);  
                    triangleLabel.setContents("Triangle");  
                    triangleLabel.setLineColor("#0000FF");
                    triangleLabel.draw();  
    
    /* This does NOT work. Label appears below the image instead of over it. */
    
            	DrawImage drawImage = new DrawImage();
            	drawImage.setDrawPane(drawPane);
            	drawImage.setLeft(200);
            	drawImage.setTop(50);
            	drawImage.setWidth(100);
            	drawImage.setHeight(100);
            	drawImage.setSrc(pathToSomeImage);
        		drawImage.draw();
            		
                    DrawLabel imageLabel = new DrawLabel();  
                    imageLabel.setDrawPane(drawPane);  
                    imageLabel.setLeft(200);  
                    imageLabel.setTop(100);  
                    imageLabel.setContents("Image");  
                    imageLabel.setLineColor("#0000FF");
                    imageLabel.draw();
    Is this a bug, or is there something else that has to be done with DrawImage to get it drawn below the DrawLabel?

    Thanks.

    #2
    This was actually due to a bug, which has been fixed for tomorrow's 3.1 and 4.x builds.

    Comment


      #3
      DrawImage always drawn above DrawLabel

      Thank you!

      When you said "tomorrow's 3.1 and 4.x builds", did you mean the build available for download today (Feb 5 nightly) or the build that will be built today (Feb 6 nightly)? Because I picked up the latest SmartGWT Pro 4.0p build today, which is dated Feb 5 (v9.0p_2014-02-05) and the fix isn't there yet.

      Comment


        #4
        We meant "tomorrow" relative to when we posted (Feb 5), so it's the Feb 6 build you need.

        Comment


          #5
          DrawImage always drawn above DrawLabel - fixed

          Thank you. I downloaded the Feb 6 build and it works as expected. Thanks for the quick turnaround on this fix!

          Comment

          Working...
          X