Hi!
I have found a problem in TK::Canvas::crateArc! It doesn't draw an arc with
outlinestipple!!! If you try to add an outlinestipple to the arcs in activeperl
canvasitem (you can run it with: Perl/bin/widget.bat) demo
(source file: Perl/site/lib/Tk/demos/widget_lib/items.pl) it will not work...
$canvas->createArc(
$p1x, $p1y, $p2x, $p2y, qw/-style arc/,
-start => $alfa1,
-extent => $alfa2, -outline => $color,
-outlinestipple => $st?'gray50':undef,
-width => $w, qw/-tags item/);
For example for the 3. Arc command could be written in the above demo program:
$c->createArc(qw/0.5c 20c 9.5c 24c -width 4m -style pieslice/,
-fill => undef, -outline => $red,
-stipple => '@'.Tk->findINC('demos/images/grey.5'),
-outlinestipple => '@'.Tk->findINC('demos/images/grey.5'),
qw/-start 225 -extent -90 -tags item/);
And it doesn't works well with outlinestipple.... Could be a bug??? But it works
well under linux (just this feature, not the demo)...
So I tried to draw an arc with createLine()...
$canvas->createLine($p1x, $p1y, $p2x, $p2y, $p3x, $p3y, qw/-smooth on/,
-stipple => $st?'gray50':undef,
-fill =>$c, -width => $w, -arrow => !$st?'last':'none',
qw/-tags item/);
But I have problems with the calculation the 2. point. The first and last points
are ok... But don't know how to calculate the 2. from an cetral and a radius to
be
the parabolic spline an exact arc...
I have read the this spline is:
so, the line is rendered as a set of parabolic
splines: one spline is drawn for the first and
second line segments, one for the second and
third, and so on.
This is ok, but how to choose the 2. point to get an exact arc???? The spline
doesn't go throu the 2. point (so would be easy...), it is in the triangle of
the 3 points.
Could somebody give me some tip about my problem...
Thx,
Sandor
I have got a tipp!!! I thougth that the 2. point should be 2*p (parabolas p
where p=r-(|mindle(p1, p3)-centrum_point|)) far from the p1,p3 line... But it
just aproximates the arcs...
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs