equal
deleted
inserted
replaced
596 sprayProcess isNil ifTrue:[ |
596 sprayProcess isNil ifTrue:[ |
597 sprayProcess := [ |
597 sprayProcess := [ |
598 |p rnd norm sprayPoint dly angle x y dist| |
598 |p rnd norm sprayPoint dly angle x y dist| |
599 |
599 |
600 rnd := Random new. |
600 rnd := Random new. |
601 norm := Distributions::NormalDistribution mean:0 deviation:0.5. |
601 Distributions::NormalDistribution notNil ifTrue:[ |
|
602 norm := Distributions::NormalDistribution mean:0 deviation:0.5. |
|
603 ]. |
602 dly := Delay forMilliseconds:5. |
604 dly := Delay forMilliseconds:5. |
603 [true] whileTrue:[ |
605 [true] whileTrue:[ |
604 10 timesRepeat:[ |
606 10 timesRepeat:[ |
605 p := sprayPosition. |
607 p := sprayPosition. |
606 p notNil ifTrue:[ |
608 p notNil ifTrue:[ |
607 angle := rnd next * 359.999. "/ the angle is uniformly ditributed |
609 angle := rnd next * 359.999. "/ the angle is uniformly ditributed |
608 dist := norm next * spraySpot. "/ the distance is a normalDistribution |
610 norm notNil ifTrue:[ |
|
611 dist := norm next * spraySpot. "/ the distance is a normalDistribution |
|
612 ] ifFalse:[ |
|
613 dist := (rnd nextBetween:-1 and:1) * spraySpot. |
|
614 ]. |
609 sprayPoint := (Point r:dist degrees:angle)*magnification. |
615 sprayPoint := (Point r:dist degrees:angle)*magnification. |
610 |
616 |
611 x := p x + sprayPoint x truncated. |
617 x := p x + sprayPoint x truncated. |
612 y := p y + sprayPoint y truncated. |
618 y := p y + sprayPoint y truncated. |
613 self pointAt:(x@y). |
619 self pointAt:(x@y). |
2546 ! ! |
2552 ! ! |
2547 |
2553 |
2548 !ImageEditView class methodsFor:'documentation'! |
2554 !ImageEditView class methodsFor:'documentation'! |
2549 |
2555 |
2550 version |
2556 version |
2551 ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.226 2008-07-14 20:22:57 cg Exp $' |
2557 ^ '$Header: /cvs/stx/stx/libwidg2/ImageEditView.st,v 1.227 2008-07-14 21:28:48 cg Exp $' |
2552 ! ! |
2558 ! ! |
2553 |
2559 |
2554 ImageEditView initialize! |
2560 ImageEditView initialize! |