[mcclim-cvs] CVS mcclim/Drei

thenriksen thenriksen at common-lisp.net
Sat Feb 16 10:30:11 UTC 2008


Update of /project/mcclim/cvsroot/mcclim/Drei
In directory clnet:/tmp/cvs-serv8962/Drei

Modified Files:
	drei-redisplay.lisp views.lisp 
Log Message:
Fixed somewhat-rare Drei redisplay issue where strokes that were changed weren't invalidated.


--- /project/mcclim/cvsroot/mcclim/Drei/drei-redisplay.lisp	2008/02/15 13:16:17	1.65
+++ /project/mcclim/cvsroot/mcclim/Drei/drei-redisplay.lisp	2008/02/16 10:30:10	1.66
@@ -318,14 +318,16 @@
            , at body)))))
 
 (defun invalidate-strokes-in-region (view start-offset end-offset
-                                     &key modified cleared)
+                                     &key modified cleared to-line-end)
   "Invalidate all the strokes of `view' that overlap the region
 `start-offset'/`end-offset' by setting their dirty-bit to
 true. If `modified' or `cleared' is true, also set their
 modified-bit to true. If `cleared' is true, inform the strokes
 that their previous output has been cleared by someone, and that
 they do not need to clear it themselves during their next
-redisplay."
+redisplay. If `to-line-end' is true, if a line is in the region,
+strokes in it will be invalidated until the end, even if line-end
+is beyond the region."
   (as-region (start-offset end-offset)
     ;; If the region is outside the visible region, no-op.
     (when (and (plusp (displayed-lines-count view)) ; If there is any display...
@@ -342,9 +344,11 @@
                                                :cleared cleared)
               ;; Only part of the line is within the region.
               else do (do-displayed-line-strokes (stroke line)
-                        (when (overlaps start-offset end-offset
-                                        (stroke-start-offset stroke)
-                                        (stroke-end-offset stroke))
+                        (when (if to-line-end
+                                  (<= start-offset (stroke-start-offset stroke))
+                                  (overlaps start-offset end-offset
+                                            (stroke-start-offset stroke)
+                                            (stroke-end-offset stroke)))
                           (invalidate-stroke stroke :modified modified
                                                     :cleared cleared)))
               if (= line1-index line2-index) do (loop-finish)
--- /project/mcclim/cvsroot/mcclim/Drei/views.lisp	2008/02/15 13:17:54	1.40
+++ /project/mcclim/cvsroot/mcclim/Drei/views.lisp	2008/02/16 10:30:10	1.41
@@ -782,7 +782,6 @@
 
 (defmethod observer-notified ((view drei-buffer-view) (buffer drei-buffer)
                               changed-region)
-  (declare (optimize (debug 3)))
   (destructuring-bind (start-offset . end-offset) changed-region
     (with-accessors ((prefix-size lines-prefix-size)
                      (suffix-size lines-suffix-size)
@@ -808,7 +807,8 @@
                                       (if newline-change
                                           (max start-offset (offset (bot view)))
                                           end-offset)
-                                      :modified t)
+                                      :modified t
+                                      :to-line-end t)
         (setf prefix-size (min start-offset prefix-size)
               suffix-size (min (- (size buffer) end-offset) suffix-size)
               buffer-size (size buffer))




More information about the Mcclim-cvs mailing list