[BUG] Blob morph can't rotate

Bob Arning arning at charm.net
Sun Feb 13 04:24:34 UTC 2000


On Sat, 12 Feb 2000 19:00:52 -0500 "David N. Smith \(IBM\)" <dnsmith at watson.ibm.com> wrote:
>Where translucence goes is a mystery; I suspect a bug in the TransformationMorph but I haven't looked yet.
>
>Anyone have any suggestions?

Well, here's a bit of a hack that keeps them translucent when rotated. It's probably got some other problems, but it's a start. (Tested at 32-bit depth only).

Cheers,
Bob

==============
!FormCanvas methodsFor: 'drawing-support' stamp: 'RAA 2/12/2000 23:17'!
transformBy: aDisplayTransform clippingTo: aClipRect during: aBlock	 smoothing: cellSize

	"Note: This method has been originally copied from TransformationMorph."
	| innerRect patchRect sourceQuad warp start subCanvas |
	(aDisplayTransform isPureTranslation) ifTrue:[
		^aBlock value: (self copyOffset: aDisplayTransform offset negated truncated
							clipRect: aClipRect)
	].
	"Prepare an appropriate warp from patch to innerRect"
	innerRect _ aClipRect.
	patchRect _ aDisplayTransform globalBoundsToLocal: innerRect.
	sourceQuad _ (aDisplayTransform sourceQuadFor: innerRect)
					collect: [:p | p - patchRect topLeft].
	warp _ self warpFrom: sourceQuad toRect: innerRect.
	warp cellSize: cellSize.

	"Render the submorphs visible in the clipping rectangle, as patchForm"
	start _ (self depth = 1 and: [self isShadowDrawing not])
		"If this is true B&W, then we need a first pass for erasure."
		ifTrue: [1] ifFalse: [2].
	start to: 2 do:
		[:i | "If i=1 we first make a shadow and erase it for opaque whites in B&W"
		subCanvas _ FormCanvas extent: patchRect extent depth: self depth.
		i=1	ifTrue: [subCanvas setShadowDrawing; stipple: Color black.
					warp combinationRule: Form erase]
			ifFalse: [self isShadowDrawing ifTrue:
					[subCanvas setShadowDrawing; stipple: self stipple].
					warp combinationRule: (self isShadowDrawing ifTrue: [Form paint] ifFalse: [Form blend])].	"<<<<one change here<<<<"
		subCanvas translateBy: patchRect topLeft negated
			during:[:offsetCanvas| aBlock value: offsetCanvas].
		warp sourceForm: subCanvas form; warpBits.
		warp sourceForm: nil.  subCanvas _ nil "release space for next loop"]
! !





More information about the Squeak-dev mailing list