jevgen / explorercanvas

Automatically exported from code.google.com/p/explorercanvas
Apache License 2.0
0 stars 0 forks source link

circle arcs don't draw at most scales #35

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am using explorercanvas R3, IE 8, WinXP.

canvas.arc() will not render when the canvas has been scaled. So far I have 
only found that 
scale(0.25,0.25) and (0.5, 0.5) work.

Other common scales, like 0.4, 0.1, etc. Will cause the circle to not show at 
all.

Attached is an HTML demonstration of this bug.

Original issue reported on code.google.com by reentry.espresso@gmail.com on 27 May 2009 at 10:57

Attachments:

GoogleCodeExporter commented 9 years ago
I found that by increasing the amount of shift in arc(), this bug is resolved:

    // IE won't render arches drawn counter clockwise if xStart == xEnd.
    if (xStart == xEnd && !aClockwise) {
      xStart += 0.5; // Offset xStart by 1/80 of a pixel. Use something
                       // that can be represented in binary
    }

It used to be xStart += 0.125;

Original comment by reentry.espresso@gmail.com on 27 May 2009 at 11:17

GoogleCodeExporter commented 9 years ago
I'm having the same problem with scaled arcs not being drawn.  Making your 
change,
however, does not appear to fix the bug for me.  (Note, I'm using the current 
svn
version, with only the one change made.)

Will play around some and see if I can figure out why it's not working for me, 
also
in XP and IE8.  

My scales usually have a negative y-value, so as to flip the vertical axis, i.e.
scale(10,-10).  Not sure if that has anything to do with it.

Original comment by ssshanest on 28 Aug 2009 at 3:58

GoogleCodeExporter commented 9 years ago
You may need a much larger jitter as you are scaling up, not down.

Original comment by reentry.espresso@gmail.com on 29 Aug 2009 at 6:07

GoogleCodeExporter commented 9 years ago
This problem may be related to the ones I was seeing.  The attached patch 
addresses
my problems, which mainly deal with performing graphics in a 0.0-1.0 coordinate 
system.

Original comment by sepiaton...@gmail.com on 23 Nov 2009 at 9:32

Attachments:

GoogleCodeExporter commented 9 years ago
I fixed the problem like this:

...
    var p = getCoords(this, aX, aY);
    var pStart = getCoords(this, xStart, yStart);
    var pEnd = getCoords(this, xEnd, yEnd);

    // Nolan change: Get the radius correctly
    var pPlusRadius = getCoords(this, aX + aRadius, aY);
    var screenRadius = (pPlusRadius.x - p.x) / Z;

    this.currentPath_.push({type: arcType,
                           x: p.x,
                           y: p.y,
                           radius: screenRadius,
                           xStart: pStart.x,
                           yStart: pStart.y,
                           xEnd: pEnd.x,
                           yEnd: pEnd.y});
...

Original comment by Nolan.Check@gmail.com on 9 Jul 2010 at 9:18

GoogleCodeExporter commented 9 years ago
@Nolan, thank you for your fix. Could you make a patch file for it agains r73? 
This works pretty well.

Original comment by sebastia...@gmail.com on 23 Jul 2012 at 10:24