[mcclim-devel] output-record-count and postscript new-page

Christophe Rhodes csr21 at cantab.net
Tue Sep 18 12:49:09 UTC 2007


Hi,

The following code produces an unexpected result in current McCLIM HEAD:

(in-package :clim-user)

(with-open-file (ps "/tmp/foo.ps" :direction :output :if-exists :supersede)
  (with-output-to-postscript-stream (s ps)
    (draw-rectangle* s 10 10 20 20)
    (new-page s)
    (draw-rectangle* s 30 30 40 40)))

The reason is that the new-page output record is no longer
contributing to the bounding rectangle of the stream output history,
so that when the history is replayed (to actually write the postscript
file) the new-page output records are not replayed.  If instead the
code is

(with-open-file (ps "/tmp/foo.ps" :direction :output :if-exists :supersede)
  (with-output-to-postscript-stream (s ps)
    (draw-rectangle* s 10 10 20 20)
    (new-page s)
    (draw-rectangle* s 30 30 40 40)
    (new-page s)
    (draw-rectangle* s -5 -5 5 5)))

You get the expected three pages (rather than the one you get when
there is no drawn content around 0,0).

This problem can be worked around by defining a method on
output-record-count for tree output records which always returns 0:
which suggests that the cases testing for output-record-count being
eql to 1 (and then doing some optimized path) in
recompute-extent-for-{new,changed}-child are optimized to the point of
being wrong...

Any ideas?

Cheers,

Christophe



More information about the mcclim-devel mailing list