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:
Is this a bug, or is there something else that has to be done with DrawImage to get it drawn below the DrawLabel?
Thanks.
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();
Thanks.
Comment