diff --git a/initcairo.c b/initcairo.c index 807fce3..bab7b4f 100644 --- a/initcairo.c +++ b/initcairo.c @@ -12,6 +12,7 @@ static Bool alwaysTruePredicate(Display *display, XEvent *event, XPointer arg) return true; } +// this computes center, radius and scalefactor out of ctx->matrix void updateDimensions(DrawingContext *ctx) { double det = ctx->matrix.xx * ctx->matrix.yy - ctx->matrix.xy * ctx->matrix.yx; diff --git a/limit_set.c b/limit_set.c index fe7d053..f3543fe 100644 --- a/limit_set.c +++ b/limit_set.c @@ -501,7 +501,8 @@ void print(DrawingContext *screen) file.width = screen->width; file.height = screen->width / sqrt(2.0); file.matrix = screen->matrix; - file.matrix.y0 += (file.height - screen->height) / 2.0; // recenter vertically + file.matrix.y0 += ((double)file.height - (double)screen->height) / 2.0; // recenter vertically + updateDimensions(&file); surface = cairo_pdf_surface_create(filename, (double)file.width, (double)file.height); file.cairo = cairo_create(surface);