Balloon canvas not scaling

Michael Latta lattam at mac.com
Sat Jan 1 18:37:44 UTC 2005


On Jan 1, 2005, at 10:04 AM, Michael Latta wrote:

> There does not appear to be an implementation of 
> Canvas>>transformBy:clippingTo:during:smoothing: (used by 
> TransformMorph for drawing submorphs) for BalloonCanvas.  This means 
> if falls back on FormCanvas which simply scales the bit map.  
> BalloonCanvas does appear to support a transform however.  Was this an 
> oversight or intentional?  I will attempt to play with it and get an 
> implementation that works, but any help or pointers would be welcome.
>
> I am trying to do zooming on morphs containing various balloon drawn 
> shapes.
>
> Michael

My first attempt has not worked out well.  I added the following 2 
methods into TransformationMorph which is the owner of the morph I am 
testing with.  I would do the real work in a subclass, but just added 
them for testing purposes.

fullDrawOn: aCanvas
	| myCanvas |
	aCanvas isBalloonCanvas ifTrue:[^super fullDrawOn: aCanvas].
	myCanvas _ aCanvas asBalloonCanvas.
	myCanvas deferred: true.
	super fullDrawOn: myCanvas.
	myCanvas flush.

transformBy: aDisplayTransform clippingTo: aClipRect during: aBlock	 
smoothing: cellSize
	"Try to implement transformed drawing for TransformMorph"
	self transformBy: aDisplayTransform.
	aBlock value: self.
	self transformBy: aDisplayTransform inverseTransformation.
	^ self

The result is a primitive failed exception here:

primSetEdgeTransform: transform
	<primitive: 'primitiveSetEdgeTransform' module: 'B2DPlugin'>
	^self primitiveFailed

WIth the input transformation being:

a MorphicTransform(angle = 0.0; scale = 2.00000000000001; offset = 
-843 at -342)

It occurs to me that possibly BalloonCanvas wants a different type of 
transformation than MorphicTransformation that is being maintained by 
TransformationMorph.  I will explore this option, but any input would 
be welcome.

Michael




More information about the Squeak-dev mailing list