'From Squeak3.2alpha of 4 November 2001 [latest update: #4518] on 22 November 2001 at 1:30:58 pm'! "Change Set: TextLinkClickError-rr-dew Date: 22 November 2001 Author: Robert Rosenbaum and Doug Way BugFixing Party @ Camp Smalltalk OOPSLA 2001. Fixes a 'Object is not in the collection' error when clicking a few pixels to the left of a text link, for example in the Welcome to... window. The error also happens if you open a new workspace, type in one word and create a new link from it (via alt-6), and then click anywhere in the workspace. This fix doesn't address the problem that the link cursor sometimes shows up when it shouldn't. (I simplified Robert's original fix version a bit. -dew)"! !NewParagraph methodsFor: 'editing' stamp: 'dew 11/22/2001 13:25'! clickAt: clickPoint for: model controller: editor "Give sensitive text a chance to fire. Display flash: (100@100 extent: 100@100)." | startBlock action target range boxes box | action _ false. startBlock _ self characterBlockAtPoint: clickPoint. (text attributesAt: startBlock stringIndex forStyle: textStyle) do: [:att | att mayActOnClick ifTrue: [(target _ model) ifNil: [target _ editor morph]. range _ text rangeOf: att startingAt: startBlock stringIndex forStyle: textStyle. boxes _ self selectionRectsFrom: (self characterBlockForIndex: range first) to: (self characterBlockForIndex: range last+1). box _ boxes detect: [:each | each containsPoint: clickPoint] ifNone: [nil]. box ifNotNil: [Utilities awaitMouseUpIn: ((editor transformFrom: nil) invertBoundsRect: box) repeating: [] ifSucceed: [(att actOnClickFor: target in: self at: clickPoint editor: editor) ifTrue: [action _ true]]. Cursor currentCursor == Cursor webLink ifTrue:[Cursor normal show]. ]]]. ^ action! !