Balloon canvas not scaling

Michael Latta lattam at mac.com
Sun Jan 2 01:52:57 UTC 2005


I rewrote it again to use a bezier curve rather than fillOval which is 
much better looking.  My question is why would ovals be worse than 
bezier curves?  This is a primitive so I am unsure where to look for 
the code that is rendering the oval so poorly.

Michael


On Jan 1, 2005, at 4:06 PM, Michael Latta wrote:

> I have this working, but the results are not all that good for 
> ellipses.  Lines look good, but ellipses are distorted.  This may have 
> to do with the brush used, but It looks odd even for that.  The 
> resulting shape is pin-cushiony.  A circle is drawn with spikes on the 
> inside of the shape, and rounded areas on the outside.  I tried a 
> screen shot but it was too large for the list filter.
>
> Michael
>
>
> On Jan 1, 2005, at 10:37 AM, Michael Latta wrote:
>
>>
>> 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