#OTHER by cg
authorClaus Gittinger <cg@exept.de>
Mon, 16 May 2016 09:49:38 +0200
changeset 16603 5bfc8ece7e14
parent 16602 c8023736aa45
child 16604 8fe42a521acf
#OTHER by cg drawing was broken; called method needs height of line in addition to the ascent; without the ascent, it cannot compute yTop and yBottom of the line.
Tools__TextDiff3Tool.st
--- a/Tools__TextDiff3Tool.st	Mon May 16 09:49:08 2016 +0200
+++ b/Tools__TextDiff3Tool.st	Mon May 16 09:49:38 2016 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 2006 by eXept Software AG
               All Rights Reserved
@@ -1122,7 +1120,8 @@
 
 !TextDiff3Tool::MergeService methodsFor:'drawing'!
 
-drawLine:lineNo in:view atX:x y:y width:w height:h from:startCol to:endColOrNil with:fg and:bg 
+drawLine:lineNo in:view atX:x y:yBaseline width:w height:hFont ascent:aFont
+    from:startCol to:endColOrNil with:fg and:bg 
     "Called by both gutterView and textView (well, not yet) to
      allow services to draw custom things on text view.
      Ask JV what the args means if unsure (I'm lazy to document
@@ -1132,23 +1131,24 @@
 
     sectionInterval := self sectionInterval.
     view == gutterView ifFalse:[ ^ self ].
+    
     info := self infoAtLine: lineNo.
     info notNil ifTrue:[ 
         color := info color.
         color notNil ifTrue:[
-            view fillRectangleX: x y:y - h 
-                    width: 8 
-                    height:h + textView lineSpacing + 5"Magic constant to make it look nicer"
-                    color: color.
+            view fillRectangleX:x y:yBaseline - hFont 
+                 width:8 
+                 height:hFont + textView lineSpacing + 5"Magic constant to make it look nicer"
+                 color:color.
         ].
     ].
 
     (sectionInterval notNil and:[sectionInterval includes: lineNo]) ifTrue:[
-            "Drawing outside annotation area is not nice, but..."
-            view fillRectangleX:view width - 7 y:y - h 
-                width:4 
-                height:h + textView lineSpacing + 5"Magic constant to make it look nicer"
-                color: Color gray.
+        "Drawing outside annotation area is not nice, but..."
+        view fillRectangleX:view width - 7 y:yBaseline - hFont 
+             width:4 
+             height:hFont + textView lineSpacing + 5"Magic constant to make it look nicer"
+             color:(Color gray).
     ]
 
     "Created: / 19-03-2012 / 13:15:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"