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

commits at source.squeak.org commits at source.squeak.org
Fri Mar 4 09:49:51 UTC 2022

Marcel Taeumel uploaded a new version of Morphic to project The Trunk:

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

Name: Morphic-mt.1923
Author: mt
Time: 4 March 2022, 10:49:45.853012 am
UUID: e57a0c3f-e53c-8b45-8dc2-41e01e0412d2
Ancestors: Morphic-mt.1922

Fixes regression regarding text-cursor visibility.

=============== Diff against Morphic-mt.1922 ===============

Item was changed:
  ----- Method: NewParagraph>>displaySelectionInLine:on: (in category 'display') -----
  displaySelectionInLine: line on: aCanvas 
  	| leftX rightX |
  	selectionStart ifNil: [^self].	"No selection"
  	aCanvas isShadowDrawing ifTrue: [ ^self ].	"don't draw selection with shadow"
  	selectionStart = selectionStop 
  			["Only show caret on line where clicked"
  			selectionStart textLine ~= line ifTrue: [^self]]
  			["Test entire selection before or after here"
  			(selectionStop stringIndex < line first 
  				or: [selectionStart stringIndex > (line last + 1)]) ifTrue: [^self].	"No selection on this line"
  			(selectionStop stringIndex = line first 
  				and: [selectionStop textLine ~= line]) ifTrue: [^self].	"Selection ends on line above"
  			(selectionStart stringIndex = (line last + 1) 
  				and: [selectionStop textLine ~= line]) ifTrue: [^self]].	"Selection begins on line below"
  	leftX := (selectionStart stringIndex <= line first 
  				ifTrue: [line ]
  				ifFalse: [selectionStart ])left.
  	rightX := (selectionStop stringIndex > (line last + 1) or: 
  					[selectionStop stringIndex = (line last + 1) 
  						and: [selectionStop textLine ~= line]]) 
  				ifTrue: [line right]
  				ifFalse: [selectionStop left].
  	selectionStart = selectionStop 
  		ifTrue: [ | w pos |
  			w := caretRect ifNotNil: [caretRect width] ifNil: [self caretWidth].
  			pos := leftX - (w // 2).
  			caretRect := pos @ line top corner: (pos + w) @ line bottom.
+ 			(self showCaret and: [self focused]) ifFalse: [^ self].
- 			self showCaret ifFalse: [^ self "e.g., not #focused"].
  			Editor dumbbellCursor
  				ifTrue: [self displayDumbbellCursorOn: aCanvas at: pos in: line]
  				ifFalse: [self displaySimpleCursorOn: aCanvas at: pos in: line]]
  		ifFalse: [
  			caretRect := nil.
  			aCanvas fillRectangle: (leftX @ line top corner: rightX @ line bottom)
  				color: (self focused ifTrue: [self selectionColor] ifFalse: [self unfocusedSelectionColor])]!

More information about the Squeak-dev mailing list