]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix caret rendering on X11, invoke-presentation stack effect
authorslava <slava@factorcode.org>
Tue, 10 Oct 2006 06:47:58 +0000 (06:47 +0000)
committerslava <slava@factorcode.org>
Tue, 10 Oct 2006 06:47:58 +0000 (06:47 +0000)
library/ui/gadgets/presentations.factor
library/ui/text/editor.factor
library/ui/text/interactor.factor

index d4cb6a58a29d1313f85527048416dcdd8e2c47b5..8fa0a621682915353213a0587f11d792e80d0d3a 100644 (file)
@@ -14,8 +14,7 @@ styles words help math models namespaces ;
 TUPLE: presentation object ;
 
 : invoke-presentation ( presentation -- )
-    dup presentation-object dup default-operation
-    invoke-command ;
+    presentation-object dup default-operation invoke-command ;
 
 : show-mouse-help ( presentation -- )
     dup find-world [ world-status set-model* ] [ drop ] if* ;
index a7bbcd1609f268cc50b5e62da87e8d75ac7e3529..ccba9944130679845cc64373b4fc559c7b20f354 100644 (file)
@@ -112,14 +112,12 @@ M: editor model-changed
     rot first rot line>y 2array ;
 
 : caret-dim ( editor -- dim )
-    line-height 1 swap 2array ;
-
-: caret-rect ( editor -- dim )
-    dup caret-loc swap caret-dim <rect> ;
+    line-height 0 swap 2array ;
 
 : scroll>caret ( editor -- )
     dup gadget-grafted? [
-        dup caret-rect over scroll>rect
+        dup caret-loc over caret-dim { 1 0 } v+ <rect>
+        over scroll>rect
     ] when drop ;
 
 M: loc-monitor model-changed
@@ -130,7 +128,7 @@ M: loc-monitor model-changed
     editor get editor-focused? [
         editor get
         dup editor-caret-color gl-color
-        caret-rect rect-extent gl-line
+        dup caret-loc swap caret-dim over v+ gl-line
     ] when ;
 
 : translate-lines ( n -- )
index 509c460068c39711c35333b0c263366d462970c5..84b6f43611ee7a236bf8d8825121e1e9d968a1e6 100644 (file)
@@ -3,7 +3,8 @@
 IN: gadgets-text
 USING: arrays definitions gadgets gadgets-panes
 generic hashtables help io kernel namespaces prettyprint styles
-threads sequences vectors definitions parser words strings ;
+threads sequences vectors definitions parser words strings
+math ;
 
 TUPLE: interactor history output continuation queue busy? ;