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

commits at source.squeak.org commits at source.squeak.org
Fri Nov 20 11:04:18 UTC 2015


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

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

Name: Morphic-mt.1049
Author: mt
Time: 20 November 2015, 12:03:39.524 pm
UUID: 5e8ed364-933c-4412-a21c-f9de5a0eead2
Ancestors: Morphic-kfr.1048

Fixes a bug with text selection and scrolling text boxes that have no soft line breaks.

=============== Diff against Morphic-kfr.1048 ===============

Item was changed:
  ----- Method: PluggableTextMorph>>scrollSelectionIntoView: (in category 'editor access') -----
  scrollSelectionIntoView: event 
+ 	"Scroll my text into view. Due to line composition mechanism, we must never use the right of a character block because the lines last character block right value always comes from a global container and is *not* line specific."
+ 	
- 	"Scroll my text into view if necessary and return true, else return false"
- 	| selRects rectToTest transform cpHere |
  	selectionInterval := textMorph editor selectionInterval.
+ 	
+ 	textMorph editor hasSelection
+ 		ifFalse: [self scrollToShow: (textMorph editor startBlock withWidth: 1)]
+ 		ifTrue: [
+ 			self scrollToShow: (textMorph editor startBlock topLeft corner: textMorph editor stopBlock bottomLeft).
+ 			self scrollToShow: (textMorph editor pointBlock withWidth: 1). "Ensure text cursor visibility."].
+ 		
- 	selRects := textMorph paragraph selectionRects.
- 	selRects isEmpty ifTrue: [^ false].
- 	rectToTest := selRects reduce: [:r1 :r2 | r1 quickMerge: r2].
- 	transform := scroller transformFrom: self.
- 	(event notNil and: [event anyButtonPressed]) ifTrue:  "Check for autoscroll"
- 		[cpHere := transform localPointToGlobal: event cursorPoint.
- 		cpHere y <= self top
- 			ifTrue: [rectToTest := selRects first topLeft extent: 2 at 2]
- 			ifFalse: [cpHere y >= self bottom
- 					ifTrue: [rectToTest := selRects last bottomRight extent: 2 at 2]
- 					ifFalse: [^ false]]].
- 	self scrollToShow: rectToTest.
- 	self scrollToShow: textMorph editor pointBlock. "Ensure text cursor visibility."
  	^ true!

Item was changed:
  ----- Method: PluggableTextMorph>>setSelection: (in category 'model access') -----
  setSelection: sel
  	selectionInterval := sel.
  	textMorph editor selectFrom: sel first to: sel last.
+ 	self scrollSelectionIntoView.!
- 	self scrollSelectionIntoView ifFalse: [scroller changed].!

Item was changed:
  ----- Method: TextMorph>>container (in category 'geometry') -----
  container
  	"Return the container for composing this text.  There are four cases:
  	1.  container is specified as, eg, an arbitrary shape,
  	2.  container is specified as the bound rectangle, because
  		this morph is linked to others,
  	3.  container is nil, and wrap is true -- grow downward as necessary,
+ 	4.  container is nil, and wrap is false -- grow in 2D as necessary."
- 	4.  container is nil, and wrap is false -- grow in 2D as nexessary."
  
  	container ifNil:
  		[successor ifNotNil: [^ self compositionRectangle].
+ 		wrapFlag ifTrue: [^ self compositionRectangle withHeight: self maximumContainerExtent y].
+ 		^ self compositionRectangle topLeft extent: self maximumContainerExtent].
- 		wrapFlag ifTrue: [^ self compositionRectangle withHeight: 9999999].
- 		^ self compositionRectangle topLeft extent: 9999999 at 9999999].
  	^ container!

Item was added:
+ ----- Method: TextMorph>>maximumContainerExtent (in category 'geometry') -----
+ maximumContainerExtent
+ 	"For text composition. Returns the maximum area for text to be composed."
+ 	
+ 	^ 9999999 at 9999999!



More information about the Squeak-dev mailing list