ListModelView.st
changeset 6091 63272e0ae72c
parent 6027 ee9c37e8e045
child 6120 360ca31c4e49
--- a/ListModelView.st	Fri Jul 19 14:37:20 2019 +0200
+++ b/ListModelView.st	Sat Jul 20 07:52:58 2019 +0200
@@ -1242,8 +1242,8 @@
 !
 
 yAbsoluteOfLine:aLineNr
-    "given a lineNr, return y-coordinate absolute
-    "
+    "given a lineNr, return its y-coordinate"
+
     |y y2 y1 cache|
 
     cache := startOfLinesY.
@@ -1256,6 +1256,8 @@
     y1 := cache at:1 ifAbsent:textStartTop.
     y2 := cache at:2 ifAbsent:(textStartTop + 16).
     ^ aLineNr * (y2 - y1) + y1
+
+    "Modified (comment): / 20-07-2019 / 07:42:00 / Claus Gittinger"
 !
 
 yAbsoluteToLineNr:yAbsolute
@@ -1343,11 +1345,11 @@
 !
 
 yVisibleOfLine:aLineNr
-    "given a lineNr, return y-coordinate in view
+    "given a lineNr, return the y-coordinate in the view
     "
     ^ (self yAbsoluteOfLine:aLineNr) - viewOrigin y
 
-
+    "Modified (comment): / 20-07-2019 / 07:42:19 / Claus Gittinger"
 !
 
 yVisibleToLineNr:yVisible
@@ -1460,22 +1462,7 @@
 
 !ListModelView methodsFor:'queries'!
 
-isLineVisible:aLineNr
-    "returns true if the line is visible"
-
-    ^ self isLineVisible:aLineNr in:self extent
-!
-
-isLineVisible:aLineNr in:anExtentPoint
-    "returns true if the line is visible"
-
-    |y|
-    y := self yVisibleOfLine:aLineNr.
-
-  ^ (y between:margin and:(anExtentPoint y - margin))
-!
-
-lineIsFullyVisible:aLineNr
+isLineFullyVisible:aLineNr
     "returns true if the line is fully visible"
 
     |y|
@@ -1485,10 +1472,38 @@
     y := self yVisibleOfLine:aLineNr.
 
     (y between:0 and:height) ifTrue:[
-	y := self yVisibleOfLine:(aLineNr + 1).
-	y <= height ifTrue:[^ true ].
+        y := self yVisibleOfLine:(aLineNr + 1).
+        y <= height ifTrue:[^ true ].
     ].
     ^ false
+
+    "Created: / 20-07-2019 / 07:50:09 / Claus Gittinger"
+!
+
+isLineVisible:aLineNr
+    "returns true if the line is visible"
+
+    ^ self isLineVisible:aLineNr in:self extent
+!
+
+isLineVisible:aLineNr in:anExtentPoint
+    "returns true if the line is visible inside the top margin and the y given by the point"
+
+    |y|
+    
+    y := self yVisibleOfLine:aLineNr.
+    ^ (y between:margin and:(anExtentPoint y - margin))
+
+    "Modified (comment): / 20-07-2019 / 07:48:19 / Claus Gittinger"
+!
+
+lineIsFullyVisible:aLineNr
+    <resource: #obsolete>
+    "returns true if the line is fully visible"
+
+    ^ self isLineFullyVisible:aLineNr
+
+    "Modified: / 20-07-2019 / 07:50:29 / Claus Gittinger"
 !
 
 numberOfLines