[squeak-dev] The Trunk: Morphic-ul.745.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Sep 26 15:13:54 UTC 2014


Levente Uzonyi uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ul.745.mcz

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

Name: Morphic-ul.745
Author: ul
Time: 26 September 2014, 5:09:59.501 pm
UUID: e53a2adf-8037-4365-86ad-842af5fa8005
Ancestors: Morphic-ul.744

- use Point >> #isZero where possible
- use #atWrap: in UserDialogBoxMorph's #selectNextButton and #selectPreviousButton

=============== Diff against Morphic-ul.744 ===============

Item was changed:
  ----- Method: HandMorph>>position: (in category 'geometry') -----
  position: aPoint
  	"Overridden to align submorph origins to the grid if gridding is on."
  	| adjustedPosition delta box |
  	adjustedPosition := aPoint.
  	temporaryCursor ifNotNil: [adjustedPosition := adjustedPosition + temporaryCursorOffset].
  
  	"Copied from Morph to avoid owner layoutChanged"
  	"Change the position of this morph and and all of its submorphs."
  	delta := adjustedPosition - bounds topLeft.
+ 	delta isZero ifTrue: [^ self].  "Null change"
- 	(delta x = 0 and: [delta y = 0]) ifTrue: [^ self].  "Null change"
  	box := self fullBounds.
  	(delta dotProduct: delta) > 100 ifTrue:[
  		"e.g., more than 10 pixels moved"
  		self invalidRect: box.
  		self invalidRect: (box translateBy: delta).
  	] ifFalse:[
  		self invalidRect: (box merge: (box translateBy: delta)).
  	].
  	self privateFullMoveBy: delta.
  !

Item was changed:
  ----- Method: Morph>>shadowOffset: (in category 'drop shadows') -----
  shadowOffset: aPoint
  	"Set the current shadow offset"
+ 
+ 	(aPoint isNil or: [ aPoint isZero ])
- 	(aPoint isNil or:[(aPoint x isZero) & (aPoint y isZero)])
  		ifTrue:[self removeProperty: #shadowOffset]
  		ifFalse:[self setProperty: #shadowOffset toValue: aPoint].!

Item was changed:
  ----- Method: SketchMorph>>extent: (in category 'geometry') -----
  extent: newExtent
  	"Change my scale to fit myself into the given extent.
  	Avoid extents where X or Y is zero."
+ 	
+ 	newExtent isZero ifTrue: [ ^self ].
- 	(newExtent y = 0 or: [ newExtent x = 0 ]) ifTrue: [ ^self ].
  	self extent = newExtent ifTrue:[^self].
  	scalePoint := newExtent asFloatPoint / (originalForm extent max: 1 at 1).
  	self layoutChanged.
  !

Item was changed:
  ----- Method: UserDialogBoxMorph>>selectNextButton (in category 'events') -----
  selectNextButton
  
  	| buttons |
  	buttons := self buttons.
+ 	self selectButton: (buttons atWrap: (buttons indexOf: selectedButton) + 1)!
- 	self selectButton: (buttons at: (buttons indexOf: selectedButton) \\ buttons size + 1)!

Item was changed:
  ----- Method: UserDialogBoxMorph>>selectPreviousButton (in category 'events') -----
  selectPreviousButton
  
+ 	| buttons |
- 	| buttons index |
  	buttons := self buttons.
+ 	self selectButton: (buttons atWrap: (buttons indexOf: selectedButton) - 1)!
- 	index := (buttons indexOf: selectedButton) - 1.
- 	index = 0 ifTrue: [ index := buttons size ].
- 	self selectButton: (buttons at: index)!



More information about the Squeak-dev mailing list