Pinboard-object clipping
Hi,
I get some unexpected, seemingly inconsistent behaviour from the following test
code. The issue relates to the dimensions of the
clip region in a pinboard-layout, as visible from a pinboard-object. On
scrolling I would expect this to be the newly-exposed region.
This is the case so long as :draw-pinboard-objects is set to t, but with
buffered drawing (:buffer or :local-buffer) the scrolling
clip region seems to correspond to the current viewport dimensions (or rather
the section of the object visible through the viewport).
If a region of the pane is merely obscured then redisplayed, however, clipping
behaves as expected.
This doesn't seem to relate to the pinboard itself, but only to its objects,
since testing with actual drawing code shows the
appropriate clipping to occur on scrolling (presumably handled by the pinboard).
I could, of course, get the dimensions of the
exposed region by providing the pinboard with a display-callback and explicitly
calling draw-pinboard-object from inside it,
with the x, y, width and height passed to the appropriate keys. I want to avoid
this, however, because on Windows I set
capi-internals:simple-pane-erase-background on my pinboard subclass to nil, so
as to eliminate flicker, which means
(as far as I can tell) that I can't provide a display-callback for that subclass
(no clearing occurs).
Is this a bug? Or should I expect this behaviour?
(defclass po (capi:pinboard-object)
()
(:default-initargs
:x 0
:y 0
:width 3000
:height 300))
(defparameter *po-clip-rects* nil)
(defmethod capi:draw-pinboard-object (pinboard (object po)
&key x y width height
&allow-other-keys)
(declare (ignore pinboard object))
(push (list x y width height) *po-clip-rects*))
(capi:contain (make-instance 'capi:pinboard-layout
:description (list (make-instance 'po))
:scroll-width 3000
:horizontal-scroll t
:fit-size-to-children nil ))
;:draw-pinboard-objects :buffer))
;Uncomment this then inspect *po-clip-rects*.
Thanks in advance,
Christopher