# HG changeset patch # User Claus Gittinger # Date 831914242 -7200 # Node ID 2c2ce53ef52744722970b19087010c5b720c7066 # Parent 6458ec5cc0337d5ef5854c48406fa651962aef88 strikeout diff -r 6458ec5cc033 -r 2c2ce53ef527 Text.st --- a/Text.st Sun May 12 17:07:30 1996 +0200 +++ b/Text.st Sun May 12 17:17:22 1996 +0200 @@ -120,9 +120,12 @@ Dialog information:(Text string:'hello' emphasis:#underline) + + Dialog + information:(Text string:'hello' emphasis:#strikeout) " - "Modified: 12.5.1996 / 17:04:34 / cg" + "Modified: 12.5.1996 / 17:16:03 / cg" ! ! !Text methodsFor:'comparing'! @@ -198,7 +201,12 @@ "display the receiver on a GC" |savedFont font color boldFont italicFont savedPaint - bold italic underline strikeout pos x l| + bold italic underline strikeout + pos "{ Class: SmallInteger }" + endPos "{ Class: SmallInteger }" + x "{ Class: SmallInteger }" + l "{ Class: SmallInteger }" + yL| savedFont := aGC basicFont. savedPaint := aGC paint. @@ -262,26 +270,32 @@ aGC basicFont:font. aGC paint:color. + endPos := pos + len - 1. opaque ifTrue:[ - aGC displayOpaqueString:string from:pos to:(pos + len - 1) x:x y:y. + aGC displayOpaqueString:string from:pos to:endPos x:x y:y. ] ifFalse:[ - aGC displayString:string from:pos to:(pos + len - 1) x:x y:y. + aGC displayString:string from:pos to:endPos x:x y:y. ]. - l := aGC font widthOf:string from:pos to:(pos + len - 1). + l := aGC font widthOf:string from:pos to:endPos. underline ifTrue:[ - aGC displayLineFromX:x y:y toX:x+l-1 y:y + yL := y+1. + aGC displayLineFromX:x y:yL toX:x+l-1 y:yL + ]. + strikeout ifTrue:[ + yL := y-(font ascent//2). + aGC displayLineFromX:x y:yL toX:x+l-1 y:yL ]. x := x + l. - pos := pos + len + pos := endPos + 1 ]. aGC basicFont:savedFont. aGC paint:savedPaint. "Created: 12.5.1996 / 11:14:30 / cg" - "Modified: 12.5.1996 / 11:55:06 / cg" + "Modified: 12.5.1996 / 17:15:23 / cg" ! displayOpaqueOn:aGC x:x y:y @@ -550,5 +564,5 @@ !Text class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libbasic2/Text.st,v 1.4 1996-05-12 15:07:30 cg Exp $' + ^ '$Header: /cvs/stx/stx/libbasic2/Text.st,v 1.5 1996-05-12 15:17:22 cg Exp $' ! !