[Pkg] The Trunk: Morphic-mt.834.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Apr 7 09:52:32 UTC 2015


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

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

Name: Morphic-mt.834
Author: mt
Time: 7 April 2015, 11:51:20.173 am
UUID: 3017c4e8-a569-ad45-b02b-20da1bc3b5a1
Ancestors: Morphic-mt.833

Fix scrolling bug in text boxes when the selection was bigger than the text box --- honors the actual text cursor/caret now.

=============== Diff against Morphic-mt.833 ===============

Item was changed:
  ----- Method: PluggableTextMorph>>scrollSelectionIntoView: (in category 'editor access') -----
  scrollSelectionIntoView: event 
  	"Scroll my text into view if necessary and return true, else return false"
+ 	| selRects rectToTest transform cpHere |
- 	| selRects delta selRect rectToTest transform cpHere |
  	selectionInterval := textMorph editor selectionInterval.
  	selRects := textMorph paragraph selectionRects.
  	selRects isEmpty ifTrue: [^ false].
+ 	rectToTest := selRects reduce: [:r1 :r2 | r1 quickMerge: r2].
- 	rectToTest := selRects first merge: selRects last.
  	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!
- 	selRect := transform localBoundsToGlobal: rectToTest.
- 	selRect height > bounds height
- 		ifTrue: [^ false].  "Would not fit, even if we tried to scroll"
- 	(delta := selRect amountToTranslateWithin: self innerBounds) y ~= 0 ifTrue:
- 		["Scroll end of selection into view if necessary"
- 		self scrollBy: 0 at delta y.
- 		^ true].
- 	^ false!

Item was added:
+ ----- Method: TextEditor>>pointBlock (in category 'accessing-selection') -----
+ pointBlock
+ 	^ pointBlock!



More information about the Packages mailing list