The Trunk: Morphic-nice.376.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-nice.376.mcz

commits-2
Nicolas Cellier uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-nice.376.mcz

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

Name: Morphic-nice.376
Author: nice
Time: 6 March 2010, 10:13:06.481 pm
UUID: cc0fedd3-a929-1443-bb36-a5b5a281df82
Ancestors: Morphic-ar.375

1) avoid using getSystemAttribute: directly (it's cryptic)
2) Reformat a PolygonMorph brace array (was unreadable)

=============== Diff against Morphic-ar.375 ===============

Item was changed:
  ----- Method: HandMorph class>>compositionWindowManager (in category 'accessing') -----
  compositionWindowManager
  CompositionWindowManager ifNotNil: [^CompositionWindowManager].
+ Smalltalk platformName = 'Win32'
- SmalltalkImage current  platformName = 'Win32'
  ifTrue: [^CompositionWindowManager := ImmWin32 new].
+ (Smalltalk platformName = 'unix'
+ and: [(Smalltalk windowSystemName) = 'X11'])
- (SmalltalkImage current  platformName = 'unix'
- and: [(SmalltalkImage current  getSystemAttribute: 1005) = 'X11'])
  ifTrue: [^CompositionWindowManager := ImmX11 new].
  ^CompositionWindowManager := ImmAbstractPlatform new!

Item was changed:
  ----- Method: PolygonMorph>>coefficients (in category 'smoothing') -----
  coefficients
  "Compute an array for the coefficients."
  | verts vertXs vertYs slopeXs slopeYs coefficients |
  curveState
  ifNotNil: [^ curveState at: 1].
  verts := self vertices.
  verts size < 1
  ifTrue: [^ self].
  "Less than three points handled as segments by our
  lineSegmentsDo:"
  (self isCurvier)
  ifFalse: [closed
  ifTrue: [verts := verts , verts first asOrderedCollection]].
+ coefficients := {
+ vertXs := verts collect: [:p | p x asFloat].
+ slopeXs := self slopes: vertXs.
+ vertXs changeInSlopes: slopeXs.
+ vertXs changeOfChangesInSlopes: slopeXs.
+ vertYs := verts collect: [:p | p y asFloat].
+ slopeYs := self slopes: vertYs.
+ vertYs changeInSlopes: slopeYs.
+ vertYs changeOfChangesInSlopes: slopeYs.
+ Array new: verts size withAll: 12}.
- coefficients := {vertXs := verts
- collect: [:p | p x asFloat]. slopeXs := self slopes: vertXs. vertXs changeInSlopes: slopeXs. vertXs changeOfChangesInSlopes: slopeXs. vertYs := verts
- collect: [:p | p y asFloat]. slopeYs := self slopes: vertYs. vertYs changeInSlopes: slopeYs. vertYs changeOfChangesInSlopes: slopeYs. Array new: verts size withAll: 12}.
  coefficients
  at: 9
  put: ((1 to: verts size)
  collect: [:i | (coefficients cubicPointPolynomialAt: i) bestSegments]).
  (self isCurvier)
  ifFalse: [closed
  ifTrue: [coefficients := coefficients
  collect: [:each | each allButLast]]].
  curveState := {coefficients. nil. nil}.
  self computeNextToEndPoints.
  ^ coefficients!