Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

clipping does not work with rectangle sets on CLX backend #1333

Open
dkochmanski opened this issue Mar 1, 2023 · 0 comments
Open

clipping does not work with rectangle sets on CLX backend #1333

dkochmanski opened this issue Mar 1, 2023 · 0 comments

Comments

@dkochmanski
Copy link
Member

Steps to reproduce:

(defun tclip-df (pane w h)
  ;; pane is a sheetless medium
  (let* ((R1    (make-bounding-rectangle  1 1 (1- w)(1- h)))
         (outer (make-bounding-rectangle 10 10  50 50))
         (inner (make-bounding-rectangle 15 5 30 15))
         ;; everywhere but inner
         (clip  (region-difference r1 inner)) ; std rectangle-set
         )
    (multiple-value-call 'draw-rectangle*
      pane (bounding-rectangle* r1)
      :ink +red+ :filled nil :line-thickness 1)

    ;; clx can't handle region-set?
    ;; note in clx medium.lisp re: yx-banding needs fixing
    (draw-design pane clip :ink +light-pink+)
    (with-drawing-options (pane :clipping-region clip)
      #+ (or)
      (multiple-value-call 'draw-rectangle*
        pane (bounding-rectangle* inner)
        :ink +magenta+ :filled t)       ; should not be seen
      (multiple-value-call 'draw-rectangle*
        pane (bounding-rectangle* outer) ; no line in protected are
        :ink +blue+ :filled nil
        :line-thickness 1))))

(defun tclip ()
  (let* ((width 150)(height 150)
         (pane (open-window-stream
                :port (find-port)
                :left 1100 :top 120
                :max-width width :max-height height
                :scroll-bars nil :borders nil
                ;;:label "Test"
                )))
    (tclip-df pane width height)
    (sleep 5)
    ;; persistent Anonymous Thread
))


(tclip )

Expected: blue rectangle outline is not complete
Observed: despite clipping /without/ a rect all is drawn

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant