Stepping through diameter of CircleMorph

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

Stepping through diameter of CircleMorph

irfankhan1
 Hi i have a new  sub class for CircleMorph which has step method.

step
self extent: self extent   +1.
(self extent )>(300@300) ifTrue: [self stopStepping]

This changes center of  circle  when i start stepping,Is there a way i can do this without changing center for CircleMorph.
Reply | Threaded
Open this post in threaded view
|

Re: Stepping through diameter of CircleMorph

Stéphane Ducasse
can you file out your class and send us the code?

Stef

On Oct 12, 2012, at 2:20 AM, irfankhan1 wrote:

> Hi i have a new  sub class for CircleMorph which has step method.
>
> step
> self extent: self extent   +1.
> (self extent )>(300@300) ifTrue: [self stopStepping]
>
> This changes center of  circle  when i start stepping,Is there a way i can
> do this without changing center for CircleMorph.
>
>
>
> --
> View this message in context: http://forum.world.st/Stepping-through-diameter-of-CircleMorph-tp4650815.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|

Re: Stepping through diameter of CircleMorph

Helene Bilbo
In reply to this post by irfankhan1
You might change the bounds instead of the extent:

step
   self bounds: ((self bounds) expandBy: 1).
   (self extent) > (200@200) ifTrue: [ self stopStepping ]

I updated my Stackoverflow answer too ;)