fixed pdf scalefactor bug
This commit is contained in:
parent
80957d590e
commit
78ad483918
@ -12,6 +12,7 @@ static Bool alwaysTruePredicate(Display *display, XEvent *event, XPointer arg)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this computes center, radius and scalefactor out of ctx->matrix
|
||||||
void updateDimensions(DrawingContext *ctx)
|
void updateDimensions(DrawingContext *ctx)
|
||||||
{
|
{
|
||||||
double det = ctx->matrix.xx * ctx->matrix.yy - ctx->matrix.xy * ctx->matrix.yx;
|
double det = ctx->matrix.xx * ctx->matrix.yy - ctx->matrix.xy * ctx->matrix.yx;
|
||||||
|
@ -501,7 +501,8 @@ void print(DrawingContext *screen)
|
|||||||
file.width = screen->width;
|
file.width = screen->width;
|
||||||
file.height = screen->width / sqrt(2.0);
|
file.height = screen->width / sqrt(2.0);
|
||||||
file.matrix = screen->matrix;
|
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);
|
surface = cairo_pdf_surface_create(filename, (double)file.width, (double)file.height);
|
||||||
file.cairo = cairo_create(surface);
|
file.cairo = cairo_create(surface);
|
||||||
|
Loading…
Reference in New Issue
Block a user