The Trunk: Graphics-mt.314.mcz

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

The Trunk: Graphics-mt.314.mcz

commits-2
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.314.mcz

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

Name: Graphics-mt.314
Author: mt
Time: 25 August 2015, 10:33:41.832 am
UUID: 07278efc-1649-e345-aa5c-f90d220a5088
Ancestors: Graphics-mt.313

Fixes form scaling to always return a copy even if the extent does not change. Adds checks for zero-length edges to increase robustness. Updates argument name to make it clear that both numbers and points are accepted, which supports uniform and non-uniform scaling.

=============== Diff against Graphics-mt.313 ===============

Item was changed:
  ----- Method: Form>>scaledToSize: (in category 'scaling, rotation') -----
+ scaledToSize: numberOrPoint
- scaledToSize: newExtent
 
+ | scale newExtent |
+ newExtent := numberOrPoint asPoint.
+
+ newExtent = self extent ifTrue: [^ self copy].
+
+ (self height isZero or: [self width isZero])
+ ifTrue: [^ self species extent: newExtent depth: self depth].
+
- | scale |
-
- newExtent = self extent ifTrue: [^self].
  scale := newExtent x / self width min: newExtent y / self height.
+ ^ self magnify: self boundingBox by: scale smoothing: 2!
- ^self magnify: self boundingBox by: scale smoothing: 2.
- !