Announcement

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

    DrawSector centerPoint

    Using SmartClient 8.1 (JavaScript) with FireFox 9.0.1

    I am trying to draw a segmented circle (like a pie chart) with DrawSector. Each of the segments has the same centerPoint. However, the end points of the segments do not meet in the center of the circle.

    Am I doing something wrong, did I misunderstand what centerPoint is for or is this a bug? Right way, fixes or work-arounds greatly appreciated.

    Here is sample code to illustrate this problem:

    Code:
    isc.DrawPane.create({
        autoDraw: true,
        ID: 'mainPane',
        showEdges: true,
        width: '100%',
        height: '100%',
        overflow: 'hidden',
        cursor: 'auto',
        canDrag: true
    });
    
    var angles = [ 90, 45, 12, 33, 120, 60 ];
    var start = 0;
    for (var i = 0; i < angles.length; i++) {
        var end = start + angles[i];
        isc.DrawSector.create({
            drawPane: mainPane,
            centerPoint: [150, 150],
            startAngle: start,
            endAngle: end,
            radius: 100
        });
        start = end;
    }

    #2
    We see a Firefox-only issue (Chrome, IE, Safari are fine) where the narrow point of one of the sectors sticks out slightly beyond the centerPoint.

    Can you post a screenshot to confirm this is what you're seeing?

    Looks like a Firefox bug, possibly involved in how they implement mitering. It only seems to happen with narrow angles (less than about 20). It does not appear to happen for smaller values of lineWidth.

    Comment


      #3
      I included the screen shot as requested. Please note that changing the lineWidth does not get rid of the bug -- it just makes it less prominent. Please see the attachment bug2_resized for an illustration. Notice how the purple slice still goes past the center point. It's not as obvious with a lower line width, but it is still noticeable.
      Attached Files

      Comment


        #4
        Thanks, yes, that's what we see.

        This has been queued to be looked at (no ETA) - we'll play with miterLimit and see if we can workaround the seeming Firefox bug here.

        Comment


          #5
          This has been fixed and checked into main - should be available in nightlies. See attached screen shot for Firefox (10.0)
          Attached Files

          Comment

          Working...
          X