|
From: SourceForge.net <no...@so...> - 2008-10-27 18:08:44
|
Bugs item #2159172, was opened at 2008-10-11 07:12 Message generated for change (Settings changed) made by sds You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=2159172&group_id=1355 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: clx Group: lisp error >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Drutsa Pavel (rawlik) Assigned to: Sam Steingold (sds) Summary: text drawing functions ignore :start & :end parameters Initial Comment: DRAW-GLYPHS and DRAW-IMAGE-GLYPHS functions ingnore :start and :end parameters ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2008-10-27 14:08 Message: thank you for your bug report. the bug has been fixed in the CVS tree. you can either wait for the next release (recommended) or check out the current CVS tree (see http://clisp.cons.org) and build CLISP from the sources (be advised that between releases the CVS tree is very unstable and may not even build on your platform). ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2008-10-27 12:53 Message: as indicated by this test, your patch does not work: (xlib:with-open-display (dpy) (let* ((top-win (xlib:create-window :parent (xlib:screen-root (first (xlib:display-roots dpy))) :x 300 :y 300 :width 300 :height 70 :bit-gravity :north-west :background 1617116666 :event-mask (xlib:make-event-mask :exposure))) (font (xlib:open-font dpy "fixed")) (timeout 0.1) (start 0) (end 1) (message "these three lines should grow together in sync") (m1 (make-array (length message) :element-type 'character :displaced-to (ext:string-concat #1="abazonk" message) :displaced-index-offset (length #1#)))) (assert (string= message m1)) (flet ((events (&rest event-data &key display event-key send-event-p window &allow-other-keys) (when (eq event-key :exposure) (let ((gc (xlib:create-gcontext :drawable window :foreground 0 :font font))) (xlib:draw-glyphs window gc 10 10 (subseq message start end)) (xlib:draw-glyphs window gc 10 30 message :start start :end end) (xlib:draw-glyphs window gc 10 30 m1 :start start :end end) )))) (xlib:map-window top-win) (xlib:display-force-output dpy) (loop (xlib:process-event dpy :handler #'events :timeout timeout :discard-p t) (incf end) (if (> end (length message)) (return)) (xlib:clear-area top-win :exposures-p t))))) in fact, there is more bad :START/:END code in clx.f, I will fix it in a uniform way. ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2008-10-27 11:56 Message: thanks - next time please supply the test case in a form suitable for new-clx/test.tst ---------------------------------------------------------------------- Comment By: Drutsa Pavel (rawlik) Date: 2008-10-27 10:43 Message: (require "clx") (defvar use-timeout 1) (defvar start-text 0) (defvar end-text 1) (defvar draw-message "Hello world! This is the start and end test") (defvar font) (defun draw-hello (drawable g-context x y text &key start end) (let ((draw-part (subseq text start end))) (xlib:draw-glyphs drawable g-context x y draw-part ) ) ) (defun events (&rest event-data &key display event-key send-event-p window &allow-other-keys) (when (eq event-key :exposure) (let ((gc (xlib:create-gcontext :drawable window :foreground 0 :font font))) (draw-hello window gc 10 10 draw-message :start start-text :end end-text) (xlib:draw-glyphs window gc 10 30 draw-message :start start-text :end end-text) ) ) ) (let* ((dpy (xlib:open-display "")) (top-win (xlib:create-window :parent (xlib:screen-root (first (xlib:display-roots dpy) )) :x 100 :y 100 :width 250 :height 250 :bit-gravity :north-west :background 1617116666 :event-mask (xlib:MAKE-EVENT-MASK :exposure))) (font (xlib:open-font dpy "fixed")) ) (xlib:map-window top-win) (xlib:display-force-output dpy) (loop (xlib:process-event dpy :handler #'events :timeout use-timeout :discard-p t) (incf end-text) (if (> end-text (length draw-message)) (setf end-text 1)) (xlib:clear-area top-win :exposures-p t) ) ) ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2008-10-23 17:20 Message: looks good. now, we need a test case and the patch will be complete. ---------------------------------------------------------------------- Comment By: Drutsa Pavel (rawlik) Date: 2008-10-22 20:25 Message: Somebody, look at my second patch, please. ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2008-10-13 12:02 Message: see test_vector_limits() ---------------------------------------------------------------------- Comment By: Drutsa Pavel (rawlik) Date: 2008-10-13 06:30 Message: I suppose that the :start and :end parameters are natural numbers. They will be truncated quiet up to the string length. That kind of other validity cheks will be suitable? ---------------------------------------------------------------------- Comment By: Sam Steingold (sds) Date: 2008-10-11 23:34 Message: thanks for the patch. you are not testing whether the :start/:stop parameters are actually valid, aren't you? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=101355&aid=2159172&group_id=1355 |