Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Morph drawOn: aCanvas
Last updated at 9:02 pm UTC on 2 June 2018
the default method to draw a morph, override in subclasses if needed.


 drawOn: aCanvas

	self wantsRoundedCorners
		ifTrue: [aCanvas frameAndFillRoundRect: self bounds 
                                 radius: self cornerRadius 
                                 fillStyle: self fillStyle 
                                 borderWidth: self borderStyle width 
                                 borderColor: self borderStyle color
                        ]
		ifFalse: [aCanvas fillRectangle: self bounds  
                                  fillStyle: self fillStyle 
                                  borderStyle: self borderStyle
                         ].

For an example/exercise see CrossMorph.

For more see Fun with Morphic