Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1977.mcz
==================== Summary ====================
Name: Morphic-mt.1977
Author: mt
Time: 28 April 2022, 2:56:50.140338 pm
UUID: 33a7d9ed-8946-a043-a299-464ddd24f41d
Ancestors: Morphic-mt.1976
Fixes lock-up regarding #haloTransitions preference.
Thanks to Lauren (lrnp) for reporting this!
=============== Diff against Morphic-mt.1976 ===============
Item was changed:
----- Method: HaloMorph>>delete (in category 'submorphs - add/remove') -----
delete
"Delete the halo. Tell the target that it no longer has the halo; accept any pending edits to the name; and then either actually delete myself or start to fade out"
self acceptNameEdit.
self isMagicHalo: false.
Preferences haloTransitions
ifFalse: [super delete]
ifTrue: [
self
+ lock; "Just a delete-animation from here on. No interaction."
stopStepping;
startStepping;
startSteppingSelector: #fadeOutFinally].
!

Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1976.mcz
==================== Summary ====================
Name: Morphic-mt.1976
Author: mt
Time: 28 April 2022, 2:40:47.022338 pm
UUID: 183b0b58-68ab-1245-8ede-ef180593957b
Ancestors: Morphic-mt.1975
Fixes halo bounds after a blue/meta click-drag.
Thanks to Tim (tcj) for reporting this issue!
=============== Diff against Morphic-mt.1975 ===============
Item was added:
+ ----- Method: HaloMorph>>mouseUp: (in category 'events') -----
+ mouseUp: evt
+
+ self endInteraction: evt.!

Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.514.mcz
==================== Summary ====================
Name: Graphics-mt.514
Author: mt
Time: 27 April 2022, 6:31:33.012285 pm
UUID: 9dde8efe-1988-4859-899b-371696b6deec
Ancestors: Graphics-mt.513
We must ensure that the GC does not collect our displayBits before we have set up new ones and communicated those to the VM.
=============== Diff against Graphics-mt.513 ===============
Item was changed:
----- Method: DisplayScreen>>restore (in category 'other') -----
restore
+ | priorBits |
+ priorBits := bits. "Must avoid to be GC'ed!!"
+ self setExtent: self class actualScreenSize depth: self nativeDepth.
+ self beDisplay.
+ priorBits := nil. "Documentation only."
- self setExtent: self class actualScreenSize depth: self nativeDepth.
- self beDisplay.
Project current ifNotNil: [:p| p displaySizeChanged].!

Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-nice.1462.mcz
==================== Summary ====================
Name: Kernel-nice.1462
Author: nice
Time: 26 April 2022, 1:24:22.90052 pm
UUID: e7c0b097-55c5-8e43-9231-9164aa4a8b4e
Ancestors: Kernel-nice.1461
Detect case of overflow in intermediate computations of Complex arithmetic (* and /), and fallback to more secured algorithm, with appropriate scaling and careful order of operations.
Rationale: the strategy consisting in letting us - programmers - choose our punition, always use slower and less accurate divideSecureBy:, or take the risk of using a faster but potentially flawed #/ is too heavy for our shoulders. This is too high a tribute to prematured optimization. A better strategy is to provide arithmetic operations that will deliver correct results when possible, and let us develop ou own FastComplex specialization if we really want to live at risks for a few CPU cycles.
An effort is made here to make the additional cost bearable.
Additional cost induced by handling of exceptional cases does not count, because replacing an incorrect result with a correct one is priceless.
Additional cost induced by detection of those conditions in non exceptional case is not that high:
- isFinite is very cheap for exact arithmetic,
- and just 1 op and 1 comparison for Float
Note that in #/ implementation, we cannot test case of null denom in precondition because denom might be non null in exact arithmetic, but later vanishing due to underflow in automatic asFloat conversion. We thus have to protect with ZeroDivide handling.
Again, a FloatComplex specialization could deal with this kind of optimization if really necessary.
=============== Diff against Kernel-nice.1461 ===============
Item was changed:
----- Method: Complex>>* (in category 'arithmetic') -----
* anObject
"Answer the result of multiplying the receiver by aNumber."
+ | a b c d x y newReal newImaginary |
- | a b c d newReal newImaginary |
anObject isComplex
ifTrue:
[a := self real.
b := self imaginary.
c := anObject real.
d := anObject imaginary.
newReal := (a * c) - (b * d).
newImaginary := (a * d) + (b * c).
+ ((newReal isFinite not or: [newImaginary isFinite not]) and: [self isZero not and: [anObject isZero not]])
+ ifTrue:
+ ["intermediate computations do overflow, but the product may be finite, retry with scaling"
+ x := a abs max: b abs.
+ y := c abs max: d abs.
+ a := a / x.
+ b := b / x.
+ c := c / y.
+ d := d / y.
+ newReal := (a * c) - (b * d) * x * y.
+ newImaginary := (a * d) + (b * c) * x * y].
^ Complex real: newReal imaginary: newImaginary]
ifFalse:
[^ anObject adaptToComplex: self andSend: #*]!
Item was changed:
----- Method: Complex>>/ (in category 'arithmetic') -----
/ anObject
"Answer the result of dividing receiver by aNumber"
+ | a b c d newReal newImaginary denom |
- | a b c d newReal newImaginary |
anObject isComplex ifTrue:
[a := self real.
b := self imaginary.
c := anObject real.
d := anObject imaginary.
+ denom := c squared + d squared.
+ [newReal := ((a * c) + (b * d)) / denom.
+ newImaginary := ((b * c) - (a * d)) / denom]
+ on: ZeroDivide do:
+ [:exc |
+ "This might be a case of underflow - resume with a value that will result in a secured retry"
+ exc resume: Float infinity].
+ (denom isFinite and: [newReal isFinite and: [newImaginary isFinite]])
+ ifFalse:
+ ["case of overflow, retry securedly"
+ ^self divideSecureBy: anObject].
- newReal := ((a * c) + (b * d)) / ((c * c) + (d * d)).
- newImaginary := ((b * c) - (a * d)) / ((c * c) + (d * d)).
^ Complex real: newReal imaginary: newImaginary].
^ anObject adaptToComplex: self andSend: #/.!