'From Squeak3.2alpha of 17 December 2001 [latest update: #4634] on 27 December 2001 at 6:00:12 pm'! "Change Set: Misc-ar Date: 22 December 2001 Author: Andreas Raab Miscellaneous issues. Fix some inconsistencies wrt. corner rounding and #innerBounds. Fix Integer>>atRandom which was perfectly usable with negative values (e.g., -5 atRandom) but got broken due to a change in #nextInt:. Fix an issue with #hasOnlySketchCostumes in 3D scripting."! !Integer methodsFor: 'truncation and round off' stamp: 'ar 12/25/2001 16:03'! atRandom "Answer a random integer from 1 to self. This implementation uses a shared generator. Heavy users should their own implementation or use Interval>atRandom: directly." self = 0 ifTrue:[^0]. self < 0 ifTrue:[^self negated atRandom negated]. ^ self atRandom: Collection randomForPicking! ! !Morph methodsFor: 'accessing' stamp: 'ar 12/27/2001 17:56'! couldHaveRoundedCorners ^ true! ! !Morph methodsFor: 'geometry' stamp: 'ar 12/22/2001 22:43'! innerBounds "Return the inner rectangle enclosed by the bounds of this morph excluding the space taken by its borders. For an unbordered morph, this is just its bounds." ^ self bounds insetBy: self borderWidth! ! !Morph methodsFor: 'visual properties' stamp: 'ar 12/22/2001 22:44'! cornerStyle ^ self valueOfProperty: #cornerStyle ifAbsent: [#square]! ! !Morph methodsFor: 'rounding' stamp: 'ar 12/22/2001 22:44'! cornerStyle: aSymbol aSymbol == #square ifTrue:[self removeProperty: #cornerStyle] ifFalse:[self setProperty: #cornerStyle toValue: aSymbol]. self changed! ! !Morph methodsFor: 'rounding' stamp: 'ar 12/25/2001 19:44'! toggleCornerRounding self cornerStyle == #rounded ifTrue: [self cornerStyle: #square] ifFalse: [self cornerStyle: #rounded]. self changed! ! !Morph methodsFor: 'rounding' stamp: 'ar 12/22/2001 22:45'! wantsRoundedCorners "Return true if the receiver wants its corners rounded" ^ self cornerStyle == #rounded! ! !FlapTab methodsFor: 'menu' stamp: 'ar 12/22/2001 22:45'! wantsRoundedCorners ^self isCurrentlyTextual or:[super wantsRoundedCorners]! ! !WonderlandActor methodsFor: 'eToy-support' stamp: 'ar 12/25/2001 16:02'! hasOnlySketchCostumes "Workaround" ^false! ! TextMorph removeSelector: #cornerStyle:! SketchMorph removeSelector: #couldHaveRoundedCorners! SketchMorph removeSelector: #wantsRoundedCorners! ImageMorph removeSelector: #innerBounds! ImageMorph removeSelector: #wantsRoundedCorners! BorderedMorph removeSelector: #cornerStyle! BorderedMorph removeSelector: #cornerStyle:! BorderedMorph removeSelector: #couldHaveRoundedCorners! BorderedMorph removeSelector: #innerBounds! BorderedMorph removeSelector: #toggleCornerRounding! BorderedMorph removeSelector: #wantsRoundedCorners!