[squeak-dev] Drawing rotated rectangles
j.mullins at gmx.com
Wed Nov 16 00:44:11 UTC 2011
Hi, I'm wondering if someone could help me with rotating rectangles... here is my current code:
drawRectangleFor: aSprite width: aWidth height: aHeight
| o canvas rect |
self createOrResizeTrailsForm. "ensure the form that we'll draw on exists"
o _ (aSprite referencePosition x + 240 )@(180 - aSprite referencePosition y).
canvas _ FormCanvas on: penTrailsForm.
rect _ Rectangle origin: o extent: (aWidth at aHeight).
canvas frameAndFillRectangle: rect fillColor: aSprite fillColor borderWidth: aSprite penSize borderColor: aSprite penColor.
I attempted to rotate canvas using transformBy: aDisplayTransform clippingTo: aClipRect during: aBlock smoothing: cellSize but I don't understand the argument during: aBlock. What code should be passed in here? I noticed the block should take one argument called offset.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev