[Pkg] The Trunk: Morphic-ul.1335.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Apr 24 12:21:38 UTC 2017
Levente Uzonyi uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ul.1335.mcz
==================== Summary ====================
Name: Morphic-ul.1335
Author: ul
Time: 24 April 2017, 1:04:42.9817 pm
UUID: 9e7af827-2124-49b6-b910-9cbdfc12a867
Ancestors: Morphic-eem.1334
- rewrote senders of #clone to use #shallowCopy
- removed some unnecessary #copy implementations
- use #postCopy in BalloonCanvas and FormCanvas for additional post-copy actions
=============== Diff against Morphic-eem.1334 ===============
Item was changed:
----- Method: BalloonCanvas>>copy (in category 'copying') -----
copy
+
self flush.
+ ^super copy!
- ^super copy resetEngine!
Item was added:
+ ----- Method: BalloonCanvas>>postCopy (in category 'copying') -----
+ postCopy
+
+ super postCopy.
+ ^self resetEngine!
Item was removed:
- ----- Method: Canvas>>copy (in category 'copying') -----
- copy
-
- ^ self clone
- !
Item was changed:
----- Method: ComplexBorder>>drawPolyPatchFrom:to:on:usingEnds: (in category 'drawing') -----
drawPolyPatchFrom: startPoint to: stopPoint on: aCanvas usingEnds: endsArray
| cos sin tfm fill dir fsOrigin fsDirection points x y |
dir := (stopPoint - startPoint) normalized.
"Compute the rotational transform from (0 at 0) -> (1 at 0) to startPoint -> stopPoint"
cos := dir dotProduct: (1 at 0).
sin := dir crossProduct: (1 at 0).
"Now get the fill style appropriate for the given direction"
fill := self fillStyleForDirection: dir.
false ifTrue:[
"Transform the fill appropriately"
+ fill := fill shallowCopy.
- fill := fill clone.
"Note: Code below is inlined from tfm transformPoint:/transformDirection:"
x := fill origin x. y := fill origin y.
fsOrigin := ((x * cos) + (y * sin) + startPoint x) @
((y * cos) - (x * sin) + startPoint y).
x := fill direction x. y := fill direction y.
fsDirection := ((x * cos) + (y * sin)) @ ((y * cos) - (x * sin)).
fill origin: fsOrigin;
direction: fsDirection rounded; "NOTE: This is a bug in the balloon engine!!!!!!"
normal: nil.
aCanvas asBalloonCanvas drawPolygon: endsArray fillStyle: fill.
] ifFalse:[
"Transform the points rather than the fills"
tfm := (MatrixTransform2x3 new) a11: cos; a12: sin; a21: sin negated; a22: cos.
"Install the start point offset"
tfm offset: startPoint.
points := endsArray collect:[:pt| tfm invertPoint: pt].
aCanvas asBalloonCanvas transformBy: tfm during:[:cc|
cc drawPolygon: points fillStyle: fill.
].
].!
Item was removed:
- ----- Method: FormCanvas>>copy (in category 'copying') -----
- copy
- "Make a copy the receiver on the same underlying Form but with its own grafPort."
-
- ^ self clone resetGrafPort
- !
Item was added:
+ ----- Method: FormCanvas>>postCopy (in category 'copying') -----
+ postCopy
+ "Let the copy have its own grafPort."
+
+ super postCopy.
+ self resetGrafPort
+ !
Item was changed:
----- Method: GrafPort>>displayScannerFor:foreground:background:ignoreColorChanges: (in category 'accessing') -----
displayScannerFor: para foreground: foreColor background: backColor ignoreColorChanges: shadowMode
^ (DisplayScanner new text: para text textStyle: para textStyle
foreground: foreColor background: backColor fillBlt: self
ignoreColorChanges: shadowMode)
+ setPort: self shallowCopy
- setPort: self clone
!
Item was changed:
----- Method: Morph>>copyWithoutSubmorph: (in category 'submorphs-add/remove') -----
copyWithoutSubmorph: sub
"Needed to get a morph to draw without one of its submorphs.
NOTE: This must be thrown away immediately after use."
+ ^ self shallowCopy privateSubmorphs: (submorphs copyWithout: sub)!
- ^ self clone privateSubmorphs: (submorphs copyWithout: sub)!
Item was changed:
----- Method: Morph>>veryDeepInner: (in category 'copying') -----
veryDeepInner: deepCopier
"The inner loop, so it can be overridden when a field should not
be traced."
"super veryDeepInner: deepCopier. know Object has no inst vars"
+ bounds := bounds shallowCopy.
- bounds := bounds clone.
"Points are shared with original"
"owner := owner. special, see veryDeepFixupWith:"
submorphs := submorphs veryDeepCopyWith: deepCopier.
"each submorph's fixup will install me as the owner"
"fullBounds := fullBounds. fullBounds is shared with original!!"
color := color veryDeepCopyWith: deepCopier.
"color, if simple, will return self. may be complex"
extension := (extension veryDeepCopyWith: deepCopier)!
Item was changed:
----- Method: MouseEvent>>asMouseEnter (in category 'converting') -----
asMouseEnter
+ ^self shallowCopy setType: #mouseEnter!
- ^self clone setType: #mouseEnter!
Item was changed:
----- Method: MouseEvent>>asMouseLeave (in category 'converting') -----
asMouseLeave
+ ^self shallowCopy setType: #mouseLeave!
- ^self clone setType: #mouseLeave!
Item was changed:
----- Method: TransformationMorph>>flexing:byTransformation: (in category 'initialization') -----
flexing: aMorph byTransformation: tfm
"Initialize me with position and bounds of aMorph,
and with an offset that provides centered rotation."
(aMorph isKindOf: TransformationMorph)
+ ifTrue: [aMorph submorphsDo: [:m | self addMorph: m shallowCopy]]
- ifTrue: [aMorph submorphsDo: [:m | self addMorph: m clone]]
ifFalse: [self addMorph: aMorph].
transform := tfm.
self chooseSmoothing.
self layoutChanged.!
More information about the Packages
mailing list