On Mon, 26 Oct 2020 at 15:15, david allen wrote:
>
> ## Background and Project Objective
> I am developing a program for mathematical modeling. The program creates cairo images showing aspects of models fit to data. The bounding boxes of the images are not known in advance. Hence the image is written to an unbounded surface to be measured later. Code to setup a recording surface is
>
> cairo_surface_t* record =
> cairo_recording_surface_create(CAIRO_CONTENT_COLOR_ALPHA, NULL);
Hmm, I wonder if you need to "flatten" this surface before you render it?
That is, I wonder if the rendering into the Fl_Box is getting confused
by the alpha channel here? It's possible that the target at that point
is only RGB, not RGBA...
That is pure speculation however...
FWIW, I ran the code (on Ubuntu) and the first time worked fine, no
background corruption. Every subsequent time, I saw some corruption
however.
Also: From your description I had expected the fltk render to be sized
to fit the star (as the PDF is) but that did not seem to be the case,
the star was rendered in the top left corner of the window. Is that as
expected?