[squeak-dev] The Inbox: Morphic-bp.1065.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Jan 12 19:51:53 UTC 2016


Bernhard Pieber uploaded a new version of Morphic to project The Inbox:
http://source.squeak.org/inbox/Morphic-bp.1065.mcz

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

Name: Morphic-bp.1065
Author: bp
Time: 12 January 2016, 8:49:11.009884 pm
UUID: e97e37b1-39c8-49e1-8f5d-e41afb141f86
Ancestors: Morphic-bp.1064

Some code improvements inspired by Marcel Taeumels code review. Thanks!

=============== Diff against Morphic-bp.1064 ===============

Item was changed:
  ----- Method: SystemWindow>>doFastFrameDrag: (in category 'events') -----
  doFastFrameDrag: grabPoint
  	"Do fast frame dragging from the given point"
  
+ 	| offset newBounds outerWorldBounds clearArea |
- 	| offset newBounds outerWorldBounds |
  	outerWorldBounds := self boundsIn: nil.
  	offset := outerWorldBounds origin - grabPoint.
+ 	clearArea := ActiveWorld clearArea.
  	newBounds := outerWorldBounds newRectFrom: [:f |
+ 		| p selector |
- 		| p a selector |
  		p := Sensor cursorPoint.
+ 		(self class dragToEdges and: [(selector := self dragToEdgesSelectorFor: p in: clearArea) notNil])
+ 			ifTrue: [clearArea perform: selector]
- 		a := ActiveWorld clearArea.
- 		(self class dragToEdges and: [(selector := self dragToEdgesSelectorFor: p in: a) notNil])
- 			ifTrue: [a perform: selector]
  			ifFalse: [p + offset extent: outerWorldBounds extent]].
  	self bounds: newBounds; comeToFront!

Item was added:
+ ----- Method: SystemWindow>>dragToEdgeDistance (in category 'resize/collapse') -----
+ dragToEdgeDistance
+ 	^10!

Item was changed:
  ----- Method: SystemWindow>>dragToEdgesSelectorFor:in: (in category 'resize/collapse') -----
  dragToEdgesSelectorFor: p in: a
  	"answer first matching drag resize selector, if none is found, answer nil"
+ 	#(isPoint:nearTopLeftOf: isPoint:nearTopRightOf: isPoint:nearBottomLeftOf: isPoint:nearBottomRightOf: isPoint:nearTopOf: isPoint:nearBottomOf: isPoint:nearLeftOf: isPoint:nearRightOf:)
- 	#(point:nearTopLeftOf: point:nearTopRightOf: point:nearBottomLeftOf: point:nearBottomRightOf: point:nearTopOf: point:nearBottomOf: point:nearLeftOf: point:nearRightOf:)
  		with: #(topLeftQuadrant topRightQuadrant bottomLeftQuadrant bottomRightQuadrant topHalf bottomHalf leftHalf rightHalf)
  		do: [:predicate :selector |
  			(self perform: predicate with: p with: a) ifTrue: [^selector]].
  	^nil!

Item was added:
+ ----- Method: SystemWindow>>isPoint:nearBottomLeftOf: (in category 'resize/collapse') -----
+ isPoint: p nearBottomLeftOf: a
+ 	^(self isPoint: p nearBottomOf: a) and: [self isPoint: p nearLeftOf: a]!

Item was added:
+ ----- Method: SystemWindow>>isPoint:nearBottomOf: (in category 'resize/collapse') -----
+ isPoint: p nearBottomOf: a
+ 	^p y > (a bottom - self dragToEdgeDistance)!

Item was added:
+ ----- Method: SystemWindow>>isPoint:nearBottomRightOf: (in category 'resize/collapse') -----
+ isPoint: p nearBottomRightOf: a
+ 	^(self isPoint: p nearBottomOf: a) and: [self isPoint: p nearRightOf: a]!

Item was added:
+ ----- Method: SystemWindow>>isPoint:nearLeftOf: (in category 'resize/collapse') -----
+ isPoint: p nearLeftOf: a
+ 	^p x < (a left + self dragToEdgeDistance)!

Item was added:
+ ----- Method: SystemWindow>>isPoint:nearRightOf: (in category 'resize/collapse') -----
+ isPoint: p nearRightOf: a
+ 	^p x > (a right - self dragToEdgeDistance)!

Item was added:
+ ----- Method: SystemWindow>>isPoint:nearTopLeftOf: (in category 'resize/collapse') -----
+ isPoint: p nearTopLeftOf: a
+ 	^(self isPoint: p nearTopOf: a) and: [self isPoint: p nearLeftOf: a]!

Item was added:
+ ----- Method: SystemWindow>>isPoint:nearTopOf: (in category 'resize/collapse') -----
+ isPoint: p nearTopOf: a
+ 	^p y < (a top + self dragToEdgeDistance)!

Item was added:
+ ----- Method: SystemWindow>>isPoint:nearTopRightOf: (in category 'resize/collapse') -----
+ isPoint: p nearTopRightOf: a
+ 	^(self isPoint: p nearTopOf: a) and: [self isPoint: p nearRightOf: a]!

Item was removed:
- ----- Method: SystemWindow>>point:nearBottomLeftOf: (in category 'resize/collapse') -----
- point: p nearBottomLeftOf: a
- 	^(self point: p nearBottomOf: a) and: [self point: p nearLeftOf: a]!

Item was removed:
- ----- Method: SystemWindow>>point:nearBottomOf: (in category 'resize/collapse') -----
- point: p nearBottomOf: a
- 	^p y > (a bottom - 10)!

Item was removed:
- ----- Method: SystemWindow>>point:nearBottomRightOf: (in category 'resize/collapse') -----
- point: p nearBottomRightOf: a
- 	^(self point: p nearBottomOf: a) and: [self point: p nearRightOf: a]!

Item was removed:
- ----- Method: SystemWindow>>point:nearLeftOf: (in category 'resize/collapse') -----
- point: p nearLeftOf: a
- 	^p x < (a left + 10)!

Item was removed:
- ----- Method: SystemWindow>>point:nearRightOf: (in category 'resize/collapse') -----
- point: p nearRightOf: a
- 	^p x > (a right - 10)!

Item was removed:
- ----- Method: SystemWindow>>point:nearTopLeftOf: (in category 'resize/collapse') -----
- point: p nearTopLeftOf: a
- 	^(self point: p nearTopOf: a) and: [self point: p nearLeftOf: a]!

Item was removed:
- ----- Method: SystemWindow>>point:nearTopOf: (in category 'resize/collapse') -----
- point: p nearTopOf: a
- 	^p y < (a top + 10)!

Item was removed:
- ----- Method: SystemWindow>>point:nearTopRightOf: (in category 'resize/collapse') -----
- point: p nearTopRightOf: a
- 	^(self point: p nearTopOf: a) and: [self point: p nearRightOf: a]!



More information about the Squeak-dev mailing list