'From Squeak3.3alpha of 11 January 2002 [latest update: #4664] on 31 January 2002 at 10:34:08 am'! "Change Set: GraphicsTwkFix-tk Date: 31 January 2002 Author: Ted Kaehler Fix two bugs in Andreas' 4640GraphicsTweaks-ar. SyntaxUpdatingStringMorph>>drawOn: computes a font (f), and then does not use it in the loop (fails when font is nil). If Morph>>insetColor asks owner for colorForInsets, which asks *its* owner for a color. One too many layers of owner are asked. And a fix of mine."! !Morph methodsFor: 'accessing' stamp: 'tk 1/31/2002 10:25'! insetColor owner ifNil:[^self color]. ^ self colorForInsets! ! !SyntaxMorph methodsFor: 'card & stack' stamp: 'tk 12/14/2001 11:58'! putOnBackground "Place the receiver, formerly private to its card, onto the shared background. If the receiver needs data carried on its behalf by the card, such data will be represented on every card." | updStr | (updStr _ self readOut) ifNotNil: ["If has a place to put per-card data, set that up." updStr getSelector ifNotNil: [ self setProperty: #holdsSeparateDataForEachInstance toValue: true]]. super putOnBackground.! ! !SyntaxUpdatingStringMorph methodsFor: 'as yet unclassified' stamp: 'tk 1/31/2002 09:53'! drawOn: aCanvas | tempForm strm where chars wid spaceWidth putLigature topOfLigature sizeOfLigature colorOfLigature dots charZero canvas f | tempForm _ Form extent: self extent depth: aCanvas depth. canvas _ tempForm getCanvas. f _ self fontToUse. spaceWidth _ f widthOf: Character space. strm _ ReadStream on: contents. charZero _ Character value: 0. "a marker for center dot ¥" where _ 0@0. topOfLigature _ self height // 2 - 1. sizeOfLigature _ (spaceWidth-2)@(spaceWidth-2). colorOfLigature _ Color black alpha: 0.45 "veryLightGray". dots _ OrderedCollection new. putLigature _ [ dots add: ((where x + 1) @ topOfLigature extent: sizeOfLigature). where _ where + (spaceWidth@0)]. strm peek = charZero ifTrue: [ strm next. putLigature value]. [strm peek = charZero] whileTrue: [strm next]. [strm atEnd] whileFalse: [ chars _ strm upTo: charZero. wid _ f widthOfString: chars. canvas drawString: chars at: where. where _ where + (wid@0). strm atEnd ifFalse: [putLigature value. [strm peek = charZero] whileTrue: [strm next]]. ]. aCanvas paintImage: tempForm at: self topLeft. dots do: [ :each | aCanvas fillRectangle: (each translateBy: self topLeft) fillStyle: colorOfLigature. ]. ! !