[Extendflash] Drawing lines without optimising
John Deans
John.Deans at theboardworks.co.uk
Wed Aug 31 12:31:44 PDT 2005
I have a solution now, of sorts.
I use two layers, and alternate which one I draw onto for each little
stroke. That way, the lines don't get smoothed. Thanks Sathesh and Tomas
for taking the time.
j
________________________________
From: extendflash-bounces at flashguru.co.uk
[mailto:extendflash-bounces at flashguru.co.uk] On Behalf Of John Deans
Sent: 31 August 2005 10:32
To: sathesh at touchtelindia.net; extendflash at flashguru.co.uk
Subject: RE: [Extendflash] Drawing lines without optimising
To clarify, I'm drawing curves made up of lots of short straight lines.
So the graph drawing function itself looks like this
function drawCurve()
{
var x1;
var y1;
var x2 = xPixMin;
//findPixel is a function that evaluates the function being graphed for
the given value of x
var y2 = 2*axisHeight + findPixel(func, xPixMin);
//Loop to draw the curve
for(var i = xPixMin; i < xPixMax; i ++)
{
x1 = x2;
y1 = y2;
x2 = i;
y2 = 2*axisHeight + findPixel(func, i);
doc.addNewLine({x:x1, y:y1}, {x:x2, y:y2});
}
}
I'm fairly sure there's nothing 'wrong' with this; it's just that the
lines all get smoothed out a bit.
________________________________
From: extendflash-bounces at flashguru.co.uk
[mailto:extendflash-bounces at flashguru.co.uk] On Behalf Of sathesh
Sent: 31 August 2005 09:52
To: extendflash at flashguru.co.uk
Subject: RE: [Extendflash] Drawing lines without optimising
Hi
>>>On Aug 30, 2005, at 9:54 AM, John Deans wrote:
I've got a graph drawing tool - you tap in a function, and it draws a
graph. The problem is that as it draws the line, I think it optimises
the curve - so that what would be, say, a nice parabola using the
Drawing API in runtime turns out to be a slightly crinkled version when
drawn in Flash using JSFL. Has anyone else come across this problem? And
has anyone got a fix?
I have done a Graph tool too but didnt come across the problem you
mentioned (im also drawing straight lines only)...can you post your
script so that we can find out where things going wrong...
-----Original Message-----
From: extendflash-bounces at flashguru.co.uk
[mailto:extendflash-bounces at flashguru.co.uk]On Behalf Of John Deans
Sent: Wednesday, August 31, 2005 2:04 PM
To: extendflash at flashguru.co.uk
Subject: RE: [Extendflash] Drawing lines without optimising
Hi,
No, I'm just drawing in straight lines - I'm calculating every
point and connecting them.
John
________________________________
From: extendflash-bounces at flashguru.co.uk
[mailto:extendflash-bounces at flashguru.co.uk] On Behalf Of Tomas van der
Haase
Sent: 30 August 2005 18:23
To: extendflash at flashguru.co.uk
Subject: Re: [Extendflash] Drawing lines without optimising
Hello:
r u drawing in cubics [ drawingLayer.cubicCurveTo() ] or
quadratics [ drawingLayer.curveTo() ]?
tomas
On Aug 30, 2005, at 9:54 AM, John Deans wrote:
Hi,
I've got a graph drawing tool - you tap in a function,
and it draws a graph.
The problem is that as it draws the line, I think it
optimises the curve - so that what would be, say, a nice parabola using
the Drawing API in runtime turns out to be a slightly crinkled version
when drawn in Flash using JSFL.
Has anyone else come across this problem? And has anyone
got a fix?
Thanks,
John
_______________________________________________
Extendflash mailing list
Extendflash at flashguru.co.uk
http://lists.flashguru.co.uk/mailman/listinfo/extendflash
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.flashguru.co.uk/pipermail/extendflash/attachments/20050831/633330fb/attachment-0001.htm
More information about the Extendflash
mailing list