[Question]fillOval: ????

Karl Ramberg karl.ramberg at chello.se
Wed Apr 26 13:51:00 UTC 2000


Why does not this code work ?
I ask it to fill a oval on a form.

?????

Karl


-------------- next part --------------
'From Squeak2.8alpha of 19 February 2000 [latest update: #2040] on 26 April 2000 at 3:47:06 pm'!

!PaintBoxMorph methodsFor: 'actions' stamp: 'kfr 4/26/2000 15:44'!
actionCursor
	"Return the cursor to use with this painting action/tool. Offset of the form must be set."

	| ff width co larger box |

action == #paint: ifTrue: ["Make a cursor from the brush and the color"
		width _ self getNib width.
		co _ (currentCursor offset - ((width negated )@34)) min: (0 at 0).
		
		larger _ width negated + 10 at 0 extent: currentCursor extent + (width-10 at width).
		ff _ currentCursor copy: larger.
		ff colors at: 1 put: Color transparent.
         	ff colors at: 2 put: Color transparent.
		ff fillOval: (Rectangle center: 20 at 20 + self topLeft  extent: 10 at 10)
			color: Color blue
			borderWidth: 1
			borderColor: Color red.
		"ff fill: (box insetBy: 1 at 1) fillColor: Color transparent."
		ff offset: co - (width at width //2).
		
		^ ff].
	
	action == #erase: ifTrue: ["Make a cursor from the cursor and the color"
		width _ self getNib width.
		co _ (currentCursor offset + (width//2 at 4)) min: (0 at 0).
		larger _ 0 at 0 extent: currentCursor extent + (width at width).
		ff _ currentCursor copy: larger.
		ff fill: (box _ co negated extent: (width at width)) 
					fillColor: (Color r: 0.5 g: 0.5 b: 1.0).
		ff fill: (box insetBy: 1 at 1) fillColor: Color transparent.
		ff offset: co - (width at width //2).
		^ ff].

	^ currentCursor
! !


More information about the Squeak-dev mailing list