Message 1 of 9
Flickering Line (redraw / grread / grdraw)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I found this routine on The Swamp that dynamically draws an irregular polygon (I've removed some extraneous following code, added the pickbox stuff and modified the grdraw line).
When the mouse is moved, the line flickers. I'm assuming this is due to the combination of redraw/grread/grdraw.
Can the code be modified to stop this flickering?
Thanks.
(defun c:DPOLY (/ PT PTLIST SS)
; Clone Select CP
; by ElpanovEvgeniy
; (2006-05-11 11:05:52)
; (lst-ent-wp)
(setq OPB (getvar "PICKBOX"))
(setq PTLIST (list (setq PT (getpoint "Specify first point : "))))
(princ "\nSpecify next point : ")
(princ)
(setvar "PICKBOX" 0)
(while
(setq PT (progn
(while (and (setq PT (grread 5)) (= (car PT) 5))
(redraw)
(mapcar
(function
(lambda (X1 X2)
(grdraw X1 X2 255 0) ;;; (grdraw x1 x2 6 5) ;;;
)
)
(cons (cadr PT) PTLIST)
(append PTLIST (cdr PT))
)
)
(if (listp (cadr PT))
(cadr PT))
) )
(setq PTLIST (cons PT PTLIST))
)
(redraw)
(setvar "PICKBOX" OPB)
(princ)
)