[squeak-dev] The Trunk: Morphic-mt.918.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Apr 24 08:59:46 UTC 2015


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

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

Name: Morphic-mt.918
Author: mt
Time: 24 April 2015, 10:59:05.15 am
UUID: 0c01118b-f2dc-a94b-a5ef-5afe9e3db39c
Ancestors: Morphic-mt.917

Speed-up text typing/updating by not invalidating the layout in the whole owner chain and thus avoiding unnecessary layout re-computation.

How it works:
1. Overwride #layoutChanged and stop the propagation coming from your (sub-) morphs.
2. Start propagation if you change your own extent, because this might affect your owner's layout.

=============== Diff against Morphic-mt.917 ===============

Item was changed:
  ----- Method: ScrollPane>>extent: (in category 'geometry') -----
+ extent: aPoint
- extent: newExtent
  	
+ 	self handleResizeAction: [
+ 		| newExtent |
+ 		newExtent := aPoint max: self minScrollbarExtent.
+ 		(bounds extent closeTo: newExtent)
+ 			ifTrue: [false]
+ 			ifFalse: [
+ 				super extent: newExtent.
+ 				super layoutChanged.
+ 				true]].!
- 	| oldW oldH |
- 	oldW := self width.
- 	oldH := self height.
- 	
- 	super extent: (newExtent max: self minScrollbarExtent).
- 
- 	"Now reset widget sizes"
- 	self
- 		resizeScrollBars;
- 		resizeScroller;
- 		hideOrShowScrollBars.
- 	
- 	"Now resetScrollDeltas where appropriate."
- 	self height ~~ oldH ifTrue: [self vSetScrollDelta].
- 	self width ~~ oldW ifTrue: [self hSetScrollDelta].
- 
- !

Item was added:
+ ----- Method: ScrollPane>>handleResizeAction: (in category 'geometry') -----
+ handleResizeAction: aBlock
+ 	"Ensure layout properties after resizing takes place."
+ 	
+ 	| oldW oldH |	
+ 	oldW := self width.
+ 	oldH := self height.
+ 	
+ 	aBlock value ifFalse: [^ self].
+ 	
+ 	"Now reset widget sizes"
+ 	self
+ 		resizeScrollBars;
+ 		resizeScroller;
+ 		hideOrShowScrollBars.
+ 	
+ 	"Now resetScrollDeltas where appropriate."
+ 	self height ~~ oldH ifTrue: [self vSetScrollDelta].
+ 	self width ~~ oldW ifTrue: [self hSetScrollDelta].!

Item was added:
+ ----- Method: ScrollPane>>layoutChanged (in category 'layout') -----
+ layoutChanged
+ 	"Do not tell owner. We might keep our bounds."
+ 	
+ 	fullBounds := nil.!

Item was added:
+ ----- Method: TransformMorph>>extent: (in category 'geometry') -----
+ extent: aPoint
+ 	"Change my layout only if I change my extent. See my implementation of #layoutChanged."
+ 
+ 	(bounds extent closeTo: aPoint) ifTrue: [^ self].
+ 	super extent: aPoint.
+ 	super layoutChanged.!

Item was changed:
  ----- Method: TransformMorph>>layoutChanged (in category 'geometry') -----
  layoutChanged
  
  	"A submorph could have moved, thus changing my localBounds. Invalidate the cache."
  	localBounds := nil.
+ 	"Only discard my fullBounds. Do not tell my owner."
+ 	fullBounds := nil.!
- 
- 	^super layoutChanged!



More information about the Squeak-dev mailing list