Lisp HUG Maillist Archive

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


RE: Pinboard-object clipping

Does anyone have a clue about this? I'm not convinced this is the behaviour I should expect.

Thanks,
Christopher

> To: lisp-hug@lispworks.com
> From: relativeflux@hotmail.co.uk
> Subject: Pinboard-object clipping
> Date: Wed, 10 Mar 2010 17:24:48 +0000
>
>
> 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
>


We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now

Re: Pinboard-object clipping

Re: Pinboard-object clipping It’s strange...
Maybe can you work around with a pixmap-graphic-port and do the buffering yourself ? For my experience this is the better way to have a nice result without flickering.
Draw directly the clipping region in the pixmap (so you can use :draw-pinboard-objects t and the clipping region will be correct) then copy the pixels to the real port (so no need to clear it before) : It’s not a lot of work and the result is absolutely perfect.

Best

Denis

Le 17/03/10 20:44, « [NOM] » <[ADRESSE]> a écrit :

> (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*.


-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------
Updated at: 2020-12-10 08:39 UTC