The Trunk: Morphic-mt.998.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-mt.998.mcz

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

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

Name: Morphic-mt.998
Author: mt
Time: 25 August 2015, 10:47:45.284 am
UUID: 3f59a840-ebfc-984d-9764-b6b3f2702ffb
Ancestors: Morphic-dtl.997

Let the extended form scaling use the basic scaling implementation. The purpose of this method is to always return a form of the given extent with a uniformly scaled form.

=============== Diff against Morphic-dtl.997 ===============

Item was changed:
  ----- Method: Form>>scaledIntoFormOfSize: (in category '*Morphic') -----
  scaledIntoFormOfSize: aNumberOrPoint
+
+ ^ self scaledIntoFormOfSize: aNumberOrPoint smoothing: 8!
- "Scale and center the receiver into a form of a given size"
-
- | extent scale scaledForm result |
-
- extent := aNumberOrPoint asPoint.
- extent = self extent ifTrue: [^ self].
-
- (self height isZero or: [self width isZero])
- ifTrue: [^ Form extent: extent depth: self depth].
-
- scale := extent y / self height min: extent x / self width.
- scaledForm := self
- magnify: self boundingBox
- by: scale
- smoothing: 8.
-
- result := Form extent: extent depth: 32.
- result getCanvas
- translucentImage: scaledForm
- at: extent - scaledForm extent // 2.
-
- ^ result
- !

Item was added:
+ ----- Method: Form>>scaledIntoFormOfSize:smoothing: (in category '*Morphic') -----
+ scaledIntoFormOfSize: aNumberOrPoint smoothing: factor
+ "Scale and center the receiver into a form of a given size"
+
+ | extent scaledForm result |
+
+ extent := aNumberOrPoint asPoint.
+ extent = self extent ifTrue: [^ self copy].
+
+ scaledForm := self scaledToSize: extent smoothing: factor.
+
+ result := self species extent: extent depth: 32.
+ result getCanvas
+ translucentImage: scaledForm
+ at: extent - scaledForm extent // 2.
+
+ ^ result
+ !