# HG changeset patch # User Claus Gittinger # Date 1394142428 -3600 # Node ID 7bc7d22565b3570cdaae9d0438099f78a883b89b # Parent 454c06ae705515dd35a88b02e93ca90a57c3de59 class: Tools::CodeView2 better redraw after scroll: for horiz. scroll, no redraw at all; for small deltas (line-scrolling), only draw affected areas. diff -r 454c06ae7055 -r 7bc7d22565b3 Tools__CodeView2.st --- a/Tools__CodeView2.st Thu Mar 06 17:20:00 2014 +0100 +++ b/Tools__CodeView2.st Thu Mar 06 22:47:08 2014 +0100 @@ -2313,19 +2313,40 @@ ! update:something with:aParameter from:changedObject -"/ self shown ifFalse:[^self]. + |deltaY numPixels hScrollerHeight| (changedObject == textView) ifTrue:[ ((something == #sizeOfContents) or:[ "false "(something == #visibility)"" ]) ifTrue:[ self adjustSizeForLongestLine. -"/ (numberOfLines ~= (textView list size max:textView cursorLine)) ifTrue:[ -"/ self invalidate. -"/ ]. + "/ (numberOfLines ~= (textView list size max:textView cursorLine)) ifTrue:[ + "/ self invalidate. + "/ ]. ^ self. ]. something == #originOfContents ifTrue:[ + aParameter notNil ifTrue:[ + deltaY := aParameter y. + deltaY = 0 ifTrue:[^ self]. + + numPixels := deltaY abs. + numPixels < (height // 5) ifTrue:[ + deltaY < 0 ifTrue:[ + self invalidateX:0 y:0 width:width height:numPixels. + ] ifFalse:[ + hScrollerHeight := 0. + (textViewScroller notNil + and:[textViewScroller horizontalScrollBar notNil]) ifTrue:[ + hScrollerHeight := textViewScroller horizontalScrollBar height. + ]. + numPixels := numPixels + 4. + self invalidateX:0 y:height-numPixels-hScrollerHeight width:width height:numPixels+hScrollerHeight. + ]. + self repairDamage. + ^ self. + ]. + ]. self invalidateLines. ^ self. ]. @@ -3878,15 +3899,15 @@ !CodeView2 class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.142 2014-03-05 13:41:18 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.143 2014-03-06 21:47:08 cg Exp $' ! version_CVS - ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.142 2014-03-05 13:41:18 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/Tools__CodeView2.st,v 1.143 2014-03-06 21:47:08 cg Exp $' ! version_SVN - ^ '$Id: Tools__CodeView2.st,v 1.142 2014-03-05 13:41:18 cg Exp $' + ^ '$Id: Tools__CodeView2.st,v 1.143 2014-03-06 21:47:08 cg Exp $' ! !