drawing an arc

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

drawing an arc

Chris Muller-3
Does anyone know how to draw an arc on a Canvas?  It has drawOval / fillOval, but I want to draw a piece of pie.


Reply | Threaded
Open this post in threaded view
|

Re: drawing an arc

Javier Diaz-Reinoso
I make a “naive” implementation of a GroupMorph, one of the class examples is a pie:


> On Dec 12, 2015, at 10:37, Chris Muller <[hidden email]> wrote:
>
> Does anyone know how to draw an arc on a Canvas?  It has drawOval / fillOval, but I want to draw a piece of pie.
>




GroupMorph.st.zip (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: drawing an arc

Bert Freudenberg
In reply to this post by Chris Muller-3
On 12.12.2015, at 16:37, Chris Muller <[hidden email]> wrote:
>
> Does anyone know how to draw an arc on a Canvas?  It has drawOval / fillOval, but I want to draw a piece of pie.


I don’t think we have that. In the Etoys image there is a SectorMorph but it’s a subclass of PolygonMorph, updating its vertices, not drawing directly on the canvas.

- Bert -





smime.p7s (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: drawing an arc

Edgar De Cleene
Second try, the first have a picture but was rejected

Yes, we have.
See atachment.
Original code I think is Hernan Morales Durand, but could be wrong


On 12/14/15, 3:22 PM, "Bert Freudenberg" <[hidden email]> wrote:

> On 12.12.2015, at 16:37, Chris Muller <[hidden email]> wrote:
>>
>> Does anyone know how to draw an arc on a Canvas?  It has drawOval / fillOval,
>> but I want to draw a piece of pie.
>
>
> I don¹t think we have that. In the Etoys image there is a SectorMorph but it¹s
> a subclass of PolygonMorph, updating its vertices, not drawing directly on the
> canvas.
>
> - Bert -





PieChartMorph-gm.5.cs (79K) Download Attachment