Announcement

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

    setLinePattern of DrawRect not works with setRounding

    The setLinePattern method of DrawRect works fine without using the setRounding method. When rounding is set, the setLinePattern has no effect, the item's line is displayed in solid style every time.
    Also for DrawOval, DrawDimaond the method has no effect.

    Code:
    import com.smartgwt.client.types.LinePattern;
    import com.smartgwt.client.widgets.drawing.DrawPane;
    import com.smartgwt.client.widgets.drawing.DrawRect;
    
    public class BorderFigure
        extends DrawPane
    {
        private int width;
        private int height;
    
        public BorderFigure(int left, int top, int width, int height)
        {
            super();
            this.width = width;
            this.height = height;
            setLeft(left);
            setTop(top);
            setWidth(width);
            setHeight(height);
            createContent();
        }
    
        private void createContent()
        {
            for ( int ii = 0; ii < LinePattern.values().length; ii++ )
            {
                final int diff = 10 + (20 * ii);
                DrawRect drawRect = new DrawRect();
                drawRect.setLeft(diff);
                drawRect.setTop(diff);
                drawRect.setWidth(width - (2 * diff));
                drawRect.setHeight(height - (2 * diff));
                drawRect.setLinePattern(LinePattern.values()[ii]);
                drawRect.setLineColor("#000000");
    //            drawRect.setRounding(0.1f);
                addDrawItem(drawRect, true);
            }
        }
    }
    The code snipset produces a range of stacked rectangles, one for every line pattern, uncommment the commented line, then you will see the effect.
    Browser Chrome, Firefox
    SmartGwt 6.0-Power (Build 20160910)
    Last edited by Huebschmann; 26 Jan 2017, 07:01.

    #2
    This looks like a bug fixed a long time ago. Please try a more recent build - see smartclient.com/builds.

    Comment


      #3
      Same problem with SmartGwt 6.0-Power (Build 20170124)

      Comment


        #4
        We've applied a fix for this to SC 9.1p/SGWT 4.1p and newer releases. It will be in the nightly builds dated 2017-01-30 and beyond.

        Note that old browsers, such as IE10 or Firefox 26, will still have the old behavior in which patterns are only applied to DrawItems composed of straight lines. In such a situation, switching from "bitmap" drawingType to "svg" may provide a workaround.

        Comment

        Working...
        X