'From Cuis 5.0 [latest update: #4520] on 13 January 2021 at 12:03:31 pm'!

!VectorCanvas methodsFor: 'drawing' stamp: 'jmv 1/13/2021 11:57:42'!
drawCurrentMorphHighlight

	currentMorph displayBounds ifNotNil: [ :r |
		(BitBltCanvasEngine toForm: form)
			combinationRule: Form blend;
			fillColor: `Color black`;
			frameRect: r borderWidth: 4;
			fillColor: `Color pink alpha: 0.2`;
			fillRect: (r insetBy: 4).
	]! !


!HybridCanvas methodsFor: 'morphic' stamp: 'jmv 1/13/2021 11:11:53'!
drawCurrentAndSubmorphs
	"If we get here, we are drawing with BitBlt, not VectorCanvas.
	Clear morphIds of pixels drawn for currentMorph"

	| b |
	self isCurrentMorphVisible ifTrue: [

		currentMorph drawOn: self.
		self onMorphIdsDo: [
			currentMorph drawOn: self ].

		world notNil ifTrue: [					"Only if we are drawing the world"
			currentMorph halo ifNotNil: [ b _ currentMorph morphLocalBounds ].
			currentMorph displayBounds: self boundingRectOfCurrentMorphAfterDraw ].
		"Display submorphs back to front"
		"coordinate system stack already set up for aMorph
		('ivars transformations' and 'currentTransformation')"
		self clippingByCurrentMorphDo: [
			currentMorph submorphsReverseDo: [ :m | self fullDraw: m ]].
		
		currentMorph postDrawOn: self.
		self onMorphIdsDo: [
			currentMorph postDrawOn: self ].
		b ifNotNil: [
			self drawCoordinateSystem: b ].
		world notNil ifTrue: [					"Only if we are drawing the world"
			currentMorph displayBounds:
				(currentMorph displayBounds quickMerge: self boundingRectOfCurrentMorphAfterDraw) ].

		currentMorph isHighlighted ifTrue: [
			self drawCurrentMorphHighlight ].
	].! !


!VectorCanvas methodsFor: 'Morphic support' stamp: 'jmv 1/13/2021 11:57:17'!
drawCurrentAndSubmorphs
	| r corners |
	self isCurrentMorphVisible ifTrue: [
		currentMorph drawOn: self.
		world notNil ifTrue: [					"Only if we are drawing the world"
			currentMorph halo ifNotNil: [
				r _ engine morphBoundsAfterDraw.
				r extent >= (200@200) ifFalse: [
					r _ Rectangle center: r center extent: (r extent max: 200@200) ].
				corners _ r corners collect: [ :pt |
					currentTransformation inverseTransform: pt ]].
			currentMorph displayBounds: self boundingRectOfCurrentMorphAfterDraw ].
		"Display submorphs back to front"
		"coordinate system stack already set up for aMorph
		('ivars transformations' and 'currentTransformation')"
		self clippingByCurrentMorphDo: [
			currentMorph submorphsReverseDo: [ :m | self fullDraw: m ]].
		currentMorph postDrawOn: self.
		corners ifNotNil: [ self drawCoordinateSystem: corners ].
		world notNil ifTrue: [					"Only if we are drawing the world"
			currentMorph displayBounds:
				(currentMorph displayBounds quickMerge: self boundingRectOfCurrentMorphAfterDraw) ].

		currentMorph isHighlighted ifTrue: [
			self drawCurrentMorphHighlight ].
	].! !

