The Trunk: Morphic-tfel.1302.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-tfel.1302.mcz

commits-2
Tim Felgentreff uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-tfel.1302.mcz

==================== Summary ====================

Name: Morphic-tfel.1302
Author: tfel
Time: 30 August 2016, 5:47:28.089349 pm
UUID: 654a8863-1a78-5d41-b7b6-17b545bda287
Ancestors: Morphic-mt.1301, Morphic-jl.1291

merge

=============== Diff against Morphic-mt.1301 ===============

Item was changed:
  ----- Method: Morph>>usableSiblingInstance (in category 'copying') -----
  usableSiblingInstance
  "Return another similar morph whose Player is of the same class as mine.
  Do not open it in the world."
 
+ | aName newPlayer newMorph topRenderer counter world |
- | aName usedNames newPlayer newMorph topRenderer |
  (topRenderer := self topRendererOrSelf) == self
  ifFalse: [^topRenderer usableSiblingInstance].
  self assuredPlayer assureUniClass.
  newMorph := self veryDeepCopySibling.
  newPlayer := newMorph player.
  newPlayer resetCostumeList.
  (aName := self knownName) isNil
  ifTrue: [self player notNil ifTrue: [aName := newMorph innocuousName]].
  "Force a difference here"
+
+ aName := aName stemAndNumericSuffix at: 1.
+
+ world := self world ifNil: [Project current world].
+ (world hasProperty: #nameCounter) ifFalse: [
+ (world setProperty: #nameCounter toValue: Dictionary new)
+ ].
+
+ counter := (world valueOfProperty: #nameCounter) at: aName ifAbsent: [1].
+ newMorph setNameTo: aName, counter.
+ (world valueOfProperty: #nameCounter)  at: aName put: counter + 1.
+
- aName notNil
- ifTrue:
- [usedNames := (self world ifNil: [OrderedCollection new]
- ifNotNil: [self world allKnownNames]) copyWith: aName.
- newMorph setNameTo: (Utilities keyLike: aName
- satisfying: [:f | (usedNames includes: f) not])].
  newMorph privateOwner: nil.
  newPlayer assureEventHandlerRepresentsStatus.
  self presenter flushPlayerListCache.
  ^newMorph!

Item was changed:
  ----- Method: TransformationMorph>>removeFlexShell (in category 'menu') -----
  removeFlexShell
  "Remove the shell used to make a morph rotatable and scalable."
 
  | oldHalo unflexed pensDown myWorld refPos aPosition |
+ self isInWorld ifFalse: [^self].
  refPos := self referencePosition.
  myWorld := self world.
  oldHalo := self halo.
  submorphs isEmpty ifTrue: [^ self delete].
  aPosition := (owner submorphIndexOf: self) ifNil: [1].
  unflexed := self firstSubmorph.
  pensDown := OrderedCollection new.
  self allMorphsDo:  "Note any pens down -- must not be down during the move"
  [:m | | player |
  ((player := m player) notNil and: [player getPenDown]) ifTrue:
  [m == player costume ifTrue:
  [pensDown add: player.
  player setPenDown: false]]].
  self submorphs do: [:m |
  m position: self center - (m extent // 2).
  owner addMorph: m asElementNumber: aPosition].
  unflexed absorbStateFromRenderer: self.
  pensDown do: [:p | p setPenDown: true].
  oldHalo ifNotNil: [oldHalo setTarget: unflexed].
  myWorld ifNotNil: [myWorld startSteppingSubmorphsOf: unflexed].
  self delete.
  unflexed referencePosition: refPos.
  ^ unflexed!