Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1178.mcz
==================== Summary ====================
Name: Tools-mt.1178
Author: mt
Time: 28 October 2022, 10:36:49.704861 am
UUID: a4ba71f3-057a-3f4e-9b06-58aa9d8a8960
Ancestors: Tools-ct.1177
Add a drag-transfer type to inspector fields to allow for custom drop actions such as into the world.
=============== Diff against Tools-ct.1177 ===============
Item was changed:
----- Method: Inspector>>buildFieldListWith: (in category 'toolbuilder') -----
buildFieldListWith: builder
^ builder pluggableListSpec new
model: self;
list: #fieldList;
getIndex: #selectionIndex;
setIndex: #selectionIndex:;
autoDeselect: true;
menu: #fieldListMenu:shifted:;
dragItem: #dragFromFieldList:;
+ dragType: #dragTypeInFieldListAt:;
dropItem: #dropOnFieldList:at:shouldCopy:;
keyPress: #inspectorKey:from:;
yourself!
Item was added:
+ ----- Method: Inspector>>dragTypeInFieldListAt: (in category 'fields - drag and drop') -----
+ dragTypeInFieldListAt: index
+
+ ^ #inspectorField!
Christoph Thiede uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.2033.mcz
==================== Summary ====================
Name: Morphic-ct.2033
Author: ct
Time: 24 August 2022, 6:02:53.835133 pm
UUID: 6b380927-4044-c24d-a1cb-b4f6feb6dae3
Ancestors: Morphic-ct.2031
Fixes an drawing/invalidation issue with TransformMorphs. When an ancestor of a TransformMorph is moved directly, it invalidates both its old and its new bounds, so the damageRect can legitimately excess the bounds of the TransformMorph. Solution: Remove the intersection of the damage rect with the TransformMorph's bounds.
Reprocase:
m := Morph new.
f := m addFlexShell
rotationDegrees: 15;
yourself.
f openInWorld.
f center: f world center.
"Do this separately"
m position: m position + 10.
Please review.
=============== Diff against Morphic-ct.2031 ===============
Item was changed:
----- Method: TransformMorph>>invalidRect:from: (in category 'change reporting') -----
invalidRect: damageRect from: aMorph
"Translate damage reports from submorphs by the scrollOffset."
+
+ ^ super
+ invalidRect: (aMorph == self
+ ifTrue: [damageRect]
+ ifFalse: [(transform localBoundsToGlobal: damageRect) expanded])
+ from: self!
- aMorph == self
- ifTrue:[super invalidRect: damageRect from: self]
- ifFalse:[super invalidRect: (((transform localBoundsToGlobal: damageRect) intersect: bounds) expanded) from: self].!
Christoph Thiede uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-ct.485.mcz
==================== Summary ====================
Name: EToys-ct.485
Author: ct
Time: 18 October 2022, 6:15:32.339427 pm
UUID: a456dbec-f901-a149-942b-74835ecc6c46
Ancestors: EToys-ct.484
Adds a tutorial on painting and creating scripts in Etoys to the help browser. The contents are mostly taken from the release image of Squeak 4.3 and revised slightly. Complements MorphicExtras-ct.337 (Etoys race car).
This commit is part of reconstruction of Objectland (also known as "The Worlds of Squeak"). For more information, see: http://forum.world.st/The-Inbox-MorphicExtras-ct-267-mcz-td5104764.html
=============== Diff against EToys-ct.484 ===============
Item was changed:
SystemOrganization addCategory: #'Etoys-Buttons'!
SystemOrganization addCategory: #'Etoys-CustomEvents'!
SystemOrganization addCategory: #'Etoys-Experimental'!
SystemOrganization addCategory: #'Etoys-OLPC-Display'!
SystemOrganization addCategory: #'Etoys-Outliner'!
SystemOrganization addCategory: #'Etoys-Protocols'!
SystemOrganization addCategory: #'Etoys-Protocols-Type Vocabularies'!
SystemOrganization addCategory: #'Etoys-ReleaseBuilder'!
SystemOrganization addCategory: #'Etoys-Scripting'!
SystemOrganization addCategory: #'Etoys-Scripting Support'!
SystemOrganization addCategory: #'Etoys-Scripting Tiles'!
SystemOrganization addCategory: #'Etoys-Squeakland-EToys-Kedama'!
SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Buttons'!
SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Calendar'!
SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Debugger'!
SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Help'!
SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Input'!
SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Scripting'!
SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Scripting Support'!
SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Scripting Tiles'!
SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-SpeechBubbles'!
SystemOrganization addCategory: #'Etoys-Squeakland-Etoys-Tile Scriptors'!
SystemOrganization addCategory: #'Etoys-Squeakland-Graphics-Text'!
SystemOrganization addCategory: #'Etoys-Squeakland-Graphics-Tools-Intersection'!
SystemOrganization addCategory: #'Etoys-Squeakland-Graphics-Tools-Simplification'!
SystemOrganization addCategory: #'Etoys-Squeakland-Graphics-Tools-Triangulation'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Basic'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Books'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Components'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Demo'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Experimental'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Games'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Games-Chess'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Games-Chess960'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-GeeMail'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Kernel'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Mentoring'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Navigators'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-PDA'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-PartsBin'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Support'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Widgets'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Windows'!
SystemOrganization addCategory: #'Etoys-Squeakland-Morphic-Worlds'!
SystemOrganization addCategory: #'Etoys-Squeakland-MorphicExtras-AdditionalMorphs'!
SystemOrganization addCategory: #'Etoys-Squeakland-MorphicExtras-Charts'!
SystemOrganization addCategory: #'Etoys-Squeakland-MorphicExtras-Postscript Filters'!
SystemOrganization addCategory: #'Etoys-Squeakland-MorphicExtras-Widgets'!
SystemOrganization addCategory: #'Etoys-Squeakland-Network-HTML-Formatter'!
SystemOrganization addCategory: #'Etoys-Squeakland-Network-HTML-Forms'!
SystemOrganization addCategory: #'Etoys-Squeakland-Network-HTML-Parser'!
SystemOrganization addCategory: #'Etoys-Squeakland-Network-HTML-Parser Entities'!
SystemOrganization addCategory: #'Etoys-Squeakland-Network-HTML-Tokenizer'!
SystemOrganization addCategory: #'Etoys-Squeakland-Network-MIME'!
SystemOrganization addCategory: #'Etoys-Squeakland-Network-TelNet WordNet'!
SystemOrganization addCategory: #'Etoys-Squeakland-Network-UI'!
SystemOrganization addCategory: #'Etoys-Squeakland-Network-Url'!
SystemOrganization addCategory: #'Etoys-Squeakland-SISS-Serialization'!
SystemOrganization addCategory: #'Etoys-Squeakland-ST80-Morphic'!
SystemOrganization addCategory: #'Etoys-Squeakland-SUnit'!
SystemOrganization addCategory: #'Etoys-Squeakland-Sound-Interface'!
SystemOrganization addCategory: #'Etoys-Squeakland-Sound-Ogg'!
SystemOrganization addCategory: #'Etoys-Squeakland-Sound-Scores'!
SystemOrganization addCategory: #'Etoys-Squeakland-Sugar'!
SystemOrganization addCategory: #'Etoys-Squeakland-Support'!
SystemOrganization addCategory: #'Etoys-Squeakland-System-Clipboard-Extended'!
SystemOrganization addCategory: #'Etoys-Squeakland-System-Compiler'!
SystemOrganization addCategory: #'Etoys-Squeakland-System-Exceptions Kernel'!
SystemOrganization addCategory: #'Etoys-Squeakland-System-Support'!
SystemOrganization addCategory: #'Etoys-Squeakland-Tools-Changes'!
SystemOrganization addCategory: #'Etoys-Squeakland-Tools-Explorer'!
SystemOrganization addCategory: #'Etoys-Squeakland-Tools-Process Browser'!
SystemOrganization addCategory: #'Etoys-Squeakland-Tweak-Kedama-ObjectVectors'!
SystemOrganization addCategory: #'Etoys-Squeakland-Tweak-Kedama-ParseTree-AttributeDefinition'!
SystemOrganization addCategory: #'Etoys-Squeakland-Tweak-Kedama-ParseTreeTransformer'!
SystemOrganization addCategory: #'Etoys-Stacks'!
SystemOrganization addCategory: #'Etoys-StarSqueak'!
SystemOrganization addCategory: #'Etoys-Support'!
SystemOrganization addCategory: #'Etoys-Tests'!
SystemOrganization addCategory: #'Etoys-Tile Scriptors'!
SystemOrganization addCategory: #'Etoys-UserInterfaceTheme'!
SystemOrganization addCategory: #'Etoys-Widgets'!
+ SystemOrganization addCategory: #'Etoys-Help'!
Item was added:
+ SqueakTutorials subclass: #SqueakTutorialsEToys
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Etoys-Help'!
Item was added:
+ ----- Method: SqueakTutorialsEToys class>>bookName (in category 'accessing') -----
+ bookName
+
+ ^ 'Etoys'!
Item was added:
+ ----- Method: SqueakTutorialsEToys class>>makingAnEtoy (in category 'pages') -----
+ makingAnEtoy
+ "This method was automatically generated. Edit it using:"
+ "SqueakTutorialsEToys edit: #makingAnEtoy"
+ <generated>
+ ^(HelpTopic
+ title: 'Making an eToy'
+ contents:
+ 'To start making an EToy, you always draw a picture. Click on the "Supplies" flap below. Drag out the Painting icon. When you drop it, you can paint a new object. Click "Keep" to end painting.
+
+ There is another way to start a painting. Open the "Nav bar" flap at the bottom of the screen. Click on the picture of the paintbrush.
+
+ When you finish a painting, the picture turns into a real Squeak object. In order to make scripts for this object, you''ll want a viewer on it. Command-click (right-click on a PC, or Alt-click) on the object to get a halo. Then click on the aqua icon of an eye.!!' readStream nextChunkText)
+ key: #makingAnEtoy;
+ shouldStyle: false;
+ yourself!
Item was added:
+ ----- Method: SqueakTutorialsEToys class>>pages (in category 'accessing') -----
+ pages
+
+ ^ self class methodsInCategory: #pages!
Item was added:
+ ----- Method: SqueakTutorialsEToys class>>raceCar (in category 'pages') -----
+ raceCar
+ "This method was automatically generated. Edit it using:"
+ "SqueakTutorialsEToys edit: #raceCar"
+ <generated>
+ ^(HelpTopic
+ title: 'Race Car'
+ contents:
+ 'There are many ways to make things in Squeak. EToys let you draw fun things and then tell them what to do.
+
+ At the right is an EToy that lets you drive a car. If you don''t see it yet, click here.
+
+ Put your mouse over the blue steering wheel (between this window and the status display). Press the "blue button" of your mouse (this can either be your right or your middle mouse key, or use the left mouse button while pressing the cmd key). A "halo" of buttons will appear. Locate the blue handle at the lower left. This rotation control lets you turn the steering wheel. Drag it around and see what happens.
+
+ Press the green "Go" button in the Stop-Step-Go controls. The race car will start moving. Put your mouse back over the steering wheel and steer the car. Press "Stop" to stop the car.
+
+ The script in the center of the racetrack makes the car go. It changes the car''s heading by reading the heading of the steering wheel. You can increase the speed of the car by clicking the up arrow of the number after "Car forward by".
+
+ Press the "Try it" button on the script, this is the left-most mouse icon.
+
+ Scripts are constructed using a parts bin called a "Viewer". Press the blue button on the race car and its halo will appear. Click at cyan eye handle on the left and press "Open viewer for player". A flap will open with the Car''s viewer in it. (Click the tiny car again to close the flap.)
+
+ You can make a new script for the Car by grabbing the tile for "Car emptyScript" and dropping it. Then grab other tiles and drop them into the script. You can see other categories of tiles by clicking on the green arrows beside the category name.
+
+ Just for fun, let''s add more things to our car. There is an alert light to the dashboard, but it does not work. If you drive off the road, we want the light to shine red.
+ 1) From the "tests" section in the car''s viewer, grab the test tile into the drive script.
+ 2) From the same category, find the test "isOverColor" tile and drag it next to the label "test" in our script.
+ 3) The tile says "Car''s isOverColor __" and a patch of color. Click on the patch of color. You will see a color picker and have an eyedropper as the cursor. Click on the gray of the street.
+ 4) Open the halo on the Alert light, and open a viewer for its player from the cyan eye handle.
+ 5) In the Alert''s viewer, find the category of commands "color & border". You may have to click on the plus icon at the right top of the viewer or on the green arrows to get it.
+ 6) The first command is "Alert''s color". Click on the square on the right with the green arrow in it. Suddenly you will have the tiles that set Alert''s color.
+ 7) Drag the left arrow for this command and drop those tiles into the "Yes" section of the script.
+ 8) Grab from the arrow next to the square again to get another copy of the tiles and put them in the "No" section.
+ 9) Decide what color the Alert should be when everything is OK. Click on the patch of color in the "No" tiles, and choose the color.
+
+ Now click Go, drive the car, and see what the Alert light does.!!
+ ]style[(184 10 450 21 2390),Rcode://
+ Player extraExampleCar do: #openInWorld;,,Rcode://
+ AllScriptsTool newStandAlone openInHand;,!!' readStream nextChunkText)
+ key: #raceCar;
+ shouldStyle: false;
+ yourself!
Item was added:
+ ----- Method: SqueakTutorialsEToys class>>usesCodeStyling (in category 'testing') -----
+ usesCodeStyling
+
+ ^ false!
Christoph Thiede uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-ct.336.mcz
==================== Summary ====================
Name: MorphicExtras-ct.336
Author: ct
Time: 18 October 2022, 1:02:37.357471 pm
UUID: 1499f112-9679-fb44-b0fc-112c9d85d772
Ancestors: MorphicExtras-ct.335
Readds the classical BlobMorph by David N Smith. It can be instantiated from the Demo page of the parts bin.
The BlobMorph was part of Squeak until Squeak 3.9.1 after when it was removed as part of a radical clean-up of not used classes (see ReleaseBuilderFor3dot10>>unloadMorphicClasses). Since it has historic value, still makes a nice example, all of its siblings (FishEyeMorph, MovingEyeMorph, et al.) have been readded again, too, and the MorphicExtras package is intended to be unloadable anyway, it makes sense to add it again.
Minor revisions:
* Converts underscore assignments to modern := assignments while preserving the prior timestamps (I hope that was ok?)
* Adds support for Squeak 6.0+ scaleFactor
* Fixes an event handling bug in #containsPoint:
Thanks to Marcel for the pointer!
=============== Diff against MorphicExtras-ct.335 ===============
Item was added:
+ PolygonMorph subclass: #BlobMorph
+ instanceVariableNames: 'random velocity sneaky'
+ classVariableNames: 'AllBlobs'
+ poolDictionaries: ''
+ category: 'MorphicExtras-Demo'!
+
+ !BlobMorph commentStamp: 'ct 10/18/2022 12:44' prior: 0!
+ The Blob was written by David N Smith. It started out as a simple test of the CurveMorph and ended up as an oozing, pulsating, repulsive mess which will wander across your screen until killed. Each instance has its own rate of oozing, so some are faster than others. It's not good for anything.
+
+ Try:
+ BlobMorph new openInWorld
+
+ 15 Jan 2000 by Bob Arning, a change so that the blob tries to be a color like the color under itself.
+ 16 Jan 2000 by David N Smith, added blob merging: if two blobs meet then one eats the other.
+ 18 Jan 2000 by Sean McGrath, smother color changes.
+ 06 Feb 2000 by Stefan Matthias Aust, refactoring and support for duplication, dragging and translucent colors.!
Item was added:
+ ----- Method: BlobMorph class>>delete: (in category 'instance remembering') -----
+ delete: anInstance
+ AllBlobs ifNotNil: [AllBlobs remove: anInstance ifAbsent: []]!
Item was added:
+ ----- Method: BlobMorph class>>descriptionForPartsBin (in category 'parts bin') -----
+ descriptionForPartsBin
+ ^ self partName: 'Blob'
+ categories: #('Demo')
+ documentation: 'A patch of primordial slime'!
Item was added:
+ ----- Method: BlobMorph class>>new (in category 'instance creation') -----
+ new
+
+ ^ self remember: super new
+ !
Item was added:
+ ----- Method: BlobMorph class>>remember: (in category 'instance remembering') -----
+ remember: anInstance
+ AllBlobs isNil ifTrue: [AllBlobs := IdentitySet new].
+ ^ AllBlobs add: anInstance!
Item was added:
+ ----- Method: BlobMorph>>adjustColors (in category 'stepping') -----
+ adjustColors
+ "Bob Arning <arning(a)charm.net>"
+ "Color mixing - Sean McGrath <sean(a)email.ces.ucsf.edu>"
+ | nearbyColors center r degrees |
+ center := bounds center.
+ nearbyColors := vertices collect:
+ [:each |
+ degrees := (each - center) degrees.
+ r := (each - center) r.
+ Display colorAt: (Point r: r + 6 px degrees: degrees) + center].
+ self color: ((self color alphaMixed: 0.95 with: (Color
+ r: (nearbyColors collect: [:each | each red]) average
+ g: (nearbyColors collect: [:each | each green]) average
+ b: (nearbyColors collect: [:each | each blue]) average))
+ alpha: self color alpha).
+ sneaky ifFalse: [self color: color negated]!
Item was added:
+ ----- Method: BlobMorph>>bounceOffWalls (in category 'stepping') -----
+ bounceOffWalls
+ " Change sign of velocity when we hit a wall of the container "
+ | ob sb |
+
+ " If owned by a handmorph we're being dragged or something;
+ don't bounce since the boundaries are different than our real parent "
+ owner isHandMorph ifTrue: [ ^ self ].
+
+ " If we're entirely within the parents bounds, we don't bounce "
+ ob := owner bounds.
+ sb := self bounds.
+ (ob containsRect: sb) ifTrue: [ ^ self ].
+
+ " We're partly outside the parents bounds; better bounce or we disappear!! "
+ sb top < ob top ifTrue: [ velocity := velocity x @ velocity y abs ].
+ sb left < ob left ifTrue: [ velocity := velocity x abs @ velocity y ].
+ sb bottom > ob bottom ifTrue: [ velocity := velocity x @ velocity y abs negated ].
+ sb right > ob right ifTrue: [ velocity := velocity x abs negated @ velocity y ].
+ !
Item was added:
+ ----- Method: BlobMorph>>containsPoint: (in category 'geometry testing') -----
+ containsPoint: aPoint
+ (self color alpha = 1.0 or: [self currentEvent blueButtonPressed])
+ ifTrue: [^ super containsPoint: aPoint].
+ ^ false!
Item was added:
+ ----- Method: BlobMorph>>defaultColor (in category 'initialization') -----
+ defaultColor
+ "answer the default color/fill style for the receiver"
+ ^ random next < 0.25
+ ifTrue: [Color random]
+ ifFalse: [Color random alpha: random next * 0.4 + 0.4]!
Item was added:
+ ----- Method: BlobMorph>>delete (in category 'submorphs - add/remove') -----
+ delete
+ self class delete: self.
+ super delete!
Item was added:
+ ----- Method: BlobMorph>>initialize (in category 'initialization') -----
+ initialize
+ "initialize the state of the receiver"
+ random := Random new.
+ sneaky := random next < 0.75.
+ super initialize.
+ ""
+ self beSmoothCurve; initializeBlobShape; setVelocity!
Item was added:
+ ----- Method: BlobMorph>>initializeBlobShape (in category 'initialization') -----
+ initializeBlobShape
+
+ self
+ vertices: {59@40. 74@54. 79@74. 77@93. 57@97. 37@97. 22@83. 15@67. 22@50. 33@35. 47@33} * RealEstateAgent scaleFactor
+ color: self color
+ borderWidth: 1 px
+ borderColor: Color black!
Item was added:
+ ----- Method: BlobMorph>>installModelIn: (in category 'debug and other') -----
+ installModelIn: aWorld
+ "Overwritten to not add handles to the receiver."!
Item was added:
+ ----- Method: BlobMorph>>limitRange: (in category 'stepping') -----
+ limitRange: verts
+ " limit radius to range 20-120; limit interpoint angle to surrounding angles with max of twice of average separation. "
+ | cent new prevn nextn prevDeg nextDeg thisDeg dincr |
+
+ cent := self bounds center.
+ new := Array new: verts size.
+ dincr := 360 // verts size.
+ verts doWithIndex: [ :pt :n |
+
+ "Find prev/next points, allowing for wrapping around "
+ prevn := n-1 < 1 ifTrue: [new size] ifFalse: [n-1].
+ nextn := n+1 > new size ifTrue: [1] ifFalse: [n+1].
+
+ "Get prev/this/next point's angles "
+ prevDeg := ((verts at: prevn)-cent) degrees.
+ thisDeg := ((verts at: n)-cent) degrees.
+ nextDeg := ((verts at: nextn)-cent) degrees.
+
+ "Adjust if this is where angles wrap from 0 to 360"
+ (thisDeg - prevDeg) abs > 180 ifTrue: [ prevDeg := prevDeg - 360 ].
+ (thisDeg - nextDeg) abs > 180 ifTrue: [ nextDeg := nextDeg + 360 ].
+
+ "Put adjusted point into new collection"
+ new at: n put: cent +
+ (self selfPolarPointRadius: ((((pt - cent) r) min: 80) max: 20)
+ degrees: (((thisDeg min: nextDeg-5) max: prevDeg+5) min: dincr*2+prevDeg)) ].
+ ^ new
+ !
Item was added:
+ ----- Method: BlobMorph>>maximumVelocity (in category 'initialization') -----
+ maximumVelocity
+ ^ 6.0!
Item was added:
+ ----- Method: BlobMorph>>mergeBlobs (in category 'stepping') -----
+ mergeBlobs
+ "See if we need to merge by checking our bounds against all other Blob
+ bounds, then all our vertices against any Blob with overlapping bounds.
+ If we find a need to merge, then someone else does all the work."
+
+ (AllBlobs isNil or: [AllBlobs size < 2])
+ ifTrue: [^ self].
+ AllBlobs
+ do:
+ [:aBlob |
+ aBlob owner == self owner ifTrue:
+ [(self bounds intersects: aBlob bounds) ifTrue:
+ [vertices do:
+ [:aPoint |
+ (aBlob containsPoint: aPoint) ifTrue:
+ [^ self mergeSelfWithBlob: aBlob atPoint: aPoint]]]]]
+ without: self!
Item was added:
+ ----- Method: BlobMorph>>mergeSelfWithBlob:atPoint: (in category 'stepping') -----
+ mergeSelfWithBlob: aBlob atPoint: aPoint
+ " It has already been determined that we merge with aBlob; we do all the work here. "
+ | v v2 c |
+
+ c := self bounds center.
+
+ " Merge the vertices by throwing them all together in one pot "
+ v := vertices, aBlob vertices.
+
+ " Sort the vertices by degrees to keep them in order "
+ v := (v asSortedCollection: [ :a :b | (a-c) degrees < (b-c) degrees ]) asArray.
+
+ " Now, pick half of the vertices so the count stays the same "
+ v2 := Array new: v size // 2.
+ 1 to: v2 size do: [ :n |
+ v2 at: n put: (v at: n+n) ].
+ v := v2.
+
+ " Average each contiguous pair to help minimize jaggies "
+ 2 to: v size do: [ :n |
+ v at: n put: ((v at: n) + (v at: n-1)) / 2.0 ].
+
+ " Remember the new vertices, set a new velocity, then delete the merged blob "
+ vertices := v.
+ self setVelocity.
+ aBlob delete
+ !
Item was added:
+ ----- Method: BlobMorph>>oozeAFewPointsOf: (in category 'stepping') -----
+ oozeAFewPointsOf: verts
+ " change some points at random to cause oozing across screen "
+ | n v |
+
+ (verts size sqrt max: 2) floor timesRepeat: [
+ n := (verts size * random next) floor + 1.
+ v := verts at: n.
+ v := (v x + (random next * 2.0 - 1.0)) @
+ (v y + (random next * 2.0 - 1.0)).
+ verts at: n put: v + (velocity * RealEstateAgent scaleFactor) ].!
Item was added:
+ ----- Method: BlobMorph>>selfPolarPointRadius:degrees: (in category 'stepping') -----
+ selfPolarPointRadius: rho degrees: theta
+ " Same as Point>>#r:degrees: in Point class except that x and y are not truncated to integers "
+ | radians x y |
+
+ radians := theta asFloat degreesToRadians.
+ x := rho asFloat * radians cos.
+ y := rho asFloat * radians sin.
+ ^ Point x: x y: y!
Item was added:
+ ----- Method: BlobMorph>>setConstrainedPosition:hangOut: (in category 'geometry') -----
+ setConstrainedPosition: aPoint hangOut: partiallyOutside
+ "Deal with dragging the blob over another blob which results in spontaneous deletations."
+
+ self owner ifNil: [^ self].
+ super setConstrainedPosition: aPoint hangOut: false.
+ "note that we keep them from overlapping"!
Item was added:
+ ----- Method: BlobMorph>>setVelocity (in category 'initialization') -----
+ setVelocity
+
+ velocity :=
+ ((random next - 0.5) * self maximumVelocity) @
+ ((random next - 0.5) * self maximumVelocity)!
Item was added:
+ ----- Method: BlobMorph>>step (in category 'stepping') -----
+ step
+ | verts |
+ self comeToFront.
+ self mergeBlobs.
+ verts := vertices copy.
+
+ " change two points at random to cause oozing across screen "
+ self oozeAFewPointsOf: verts.
+
+ " limit radius and interpoint angle "
+ verts := self limitRange: verts.
+
+ " Set new vertices; bounce off a wall if necessary "
+ self setVertices: verts.
+ self bounceOffWalls.
+ self adjustColors
+ !
Item was added:
+ ----- Method: BlobMorph>>stepTime (in category 'stepping') -----
+ stepTime
+ "Answer the desired time between steps in milliseconds."
+
+ ^ 125!
Item was added:
+ ----- Method: BlobMorph>>veryDeepCopy (in category 'copying') -----
+ veryDeepCopy
+ ^ self class remember: super veryDeepCopy!
Christoph Thiede uploaded a new version of Installer-Core to project The Trunk:
http://source.squeak.org/trunk/Installer-Core-ct.452.mcz
==================== Summary ====================
Name: Installer-Core-ct.452
Author: ct
Time: 15 October 2022, 8:24:18.050533 pm
UUID: d845f390-c267-3c49-ac35-31f0d34b04a3
Ancestors: Installer-Core-ct.451
Fixes a bug in new #ensureRecentMetacello that polluted the current change set with the preamble the SAR file.
=============== Diff against Installer-Core-ct.451 ===============
Item was changed:
----- Method: Installer class>>ensureRecentMetacello (in category 'scripts') -----
ensureRecentMetacello
"Copied and adapted from https://github.com/Metacello/metacello/blob/master/README.md"
| metacello |
((Smalltalk classNamed: #WebClient)
ifNil: [ false ]
ifNotNil: [ :webClient |
[ (webClient httpHead: 'https://github.com') isSuccess ]
on: Error
do: [ false ] ])
ifFalse: [ ^self inform: 'Could not connect to "https://github.com".\\You need an internet connection and SSL support\to install (or update) Metacello.\\Please fix those issues and try again.' translated withCRs ].
self isMetacelloInstalled ifFalse: [
| response |
"Download base archive of Metacello."
response := WebClient httpGet: 'https://files.squeak.org/metacello/metacello-squeak60.sar'.
response isSuccess ifFalse: [
self error: ('Could not download Metacello archive: {1}' translated format: {response status})].
"Prepare a clean environment and install it."
Smalltalk globals removeKey: #Metacello ifAbsent: ["Ignore prior attempts."].
+ self new installSAR: 'metacello-squeak60.sar' from: response content asByteArray readStream].
- SARInstaller new fileInFrom: response content asByteArray readStream].
metacello := Smalltalk classNamed: #Metacello.
"Now load latest version of Metacello"
metacello new
baseline: 'Metacello';
repository: 'github://Metacello/metacello:master/repository';
get;
load: #('default' 'Metacello-Help').!