Skip to content

Commit

Permalink
Fix for [5423699f10]
Browse files Browse the repository at this point in the history
  • Loading branch information
codebykevin committed Oct 19, 2023
1 parent 93122cd commit c0e45b4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions macosx/tkMacOSXPrint.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,13 @@ FinishPrint(
*/

int MakePDF
(void *clientData,
(TCL_UNUSED(ClientData),
Tcl_Interp *ip,
int objc,
Tcl_Obj *const objv[])
{
Tk_Window path;
Drawable d = NULL;
int x, y;
Drawable d;
unsigned int width, height;
CFDataRef pdfData;

Expand All @@ -374,9 +373,8 @@ int MakePDF
d = Tk_WindowId(path);
width = Tk_Width(path);
height = Tk_Height(path);
MacDrawable *mac_drawable = (MacDrawable *)d;

pdfData = CreatePDFFromDrawableRect(mac_drawable, 0, 0, width, height);
pdfData = CreatePDFFromDrawableRect(d, 0, 0, width, height);

NSData *viewData = (NSData*)pdfData;
[viewData writeToFile:@"/tmp/tk_canvas.pdf" atomically:YES];
Expand Down

0 comments on commit c0e45b4

Please sign in to comment.