'From Squeak3.7gamma of ''17 July 2004'' [latest update: #5976] on 17 July 2004 at 11:09:12 am'! "Change Set: ImageAndSketchFixes-nk Date: 12 June 2004 Author: Ned Konz - Fixes a bug where a ColorPickerMorph could sometimes cause a walkback on deletion. - Fixes a bug where GradientFillStyles could cause walkbacks during editing. - Fixes a bug where resizing a SketchMorph to be 0x0 would cause a divide by 0 error. "! !GradientFillStyle methodsFor: 'Morphic menu' stamp: 'nk 7/18/2003 16:35'! firstColor: aColor forMorph: aMorph hand: aHand colorRamp first value: aColor. isTranslucent _ nil. pixelRamp _ nil. aMorph changed.! ! !GradientFillStyle methodsFor: 'Morphic menu' stamp: 'nk 7/18/2003 16:35'! lastColor: aColor forMorph: aMorph hand: aHand colorRamp last value: aColor. isTranslucent _ nil. pixelRamp _ nil. aMorph changed.! ! !SketchMorph methodsFor: 'accessing' stamp: 'nk 1/24/2004 23:46'! useInterpolation: aBool (aBool == true and: [ Smalltalk includesKey: #B3DRenderEngine ]) ifTrue:[self setProperty: #useInterpolation toValue: aBool] ifFalse:[self removeProperty: #useInterpolation]. self layoutChanged. "to regenerate the form" ! ! !SketchMorph methodsFor: 'geometry' stamp: 'nk 1/10/2004 14:51'! extent: newExtent "Change my scale to fit myself into the given extent. Avoid extents where X or Y is zero." (newExtent y = 0 or: [ newExtent x = 0 ]) ifTrue: [ ^self ]. self extent = newExtent ifTrue:[^self]. scalePoint _ newExtent asFloatPoint / (originalForm extent max: 1@1). self layoutChanged. ! ! !ColorPickerMorph methodsFor: 'submorphs-add/remove' stamp: 'nk 4/17/2004 19:34'! delete "The moment of departure has come. If the receiver has an affiliated command, finalize it and have the system remember it. In any case, delete the receiver" (selector isNil or: [ target isNil ]) ifFalse: [ self rememberCommand: (Command new cmdWording: 'color change' translated; undoTarget: target selector: selector arguments: (self argumentsWith: originalColor); redoTarget: target selector: selector arguments: (self argumentsWith: selectedColor)). ]. super delete! ! !ColorPickerMorph reorganize! ('accessing' argument argument: deleteOnMouseUp deleteOnMouseUp: locationIndicator originalColor: selectedColor selector selector: sourceHand sourceHand: target target: updateContinuously updateContinuously:) ('drawing' drawOn:) ('e-toy support' isCandidateForAutomaticViewing) ('event handling' handlesMouseDown: inhibitDragging mouseDown: mouseUp:) ('geometry testing' containsPoint:) ('halos and balloon help' isLikelyRecipientForMouseOverHalos) ('initialization' buildChartForm choseModalityFromPreference initialize initializeForPropertiesPanel initializeModal: updateSelectorDisplay) ('menu' addCustomMenuItems:hand: pickUpColorFor: toggleDeleteOnMouseUp toggleUpdateContinuously) ('other' addToWorld:near: bestPositionNear:inWorld: indicateColorUnderMouse putUpFor:near: trackColorUnderMouse) ('stepping and presenter' step) ('submorphs-add/remove' delete) ('testing' stepTime) ('private' anchorAndRunModeless: argumentsWith: deleteAllBalloons modalBalloonHelpAtPoint: pickColorAt: positionOfColor: trackColorAt: updateAlpha: updateColor:feedbackColor: updateTargetColor updateTargetColorWith:) !