Tk Source Code

Artifact [8daa7da3]
Login

Artifact 8daa7da374fdae7e9018b2129a057a5205cddd8aebdf1608b95973afdb514b72:

Attachment "print.diff" to ticket [d2eac285] added by emiliano 2025-04-25 18:54:45.
Index: library/print.tcl
==================================================================
--- library/print.tcl
+++ library/print.tcl
@@ -277,12 +277,12 @@
 	    # wants the canvas dimensions, and not the WINDOW dimensions.
 	    if {[winfo class $wid] eq "Canvas"} {
 		set sc [$wid cget -scrollregion]
 		# if there is no scrollregion, use width and height.
 		if {$sc eq ""} {
-		    set window_x [$wid cget -width]
-		    set window_y [$wid cget -height]
+		    set window_x [winfo pixels $wid [$wid cget -width]]
+		    set window_y [winfo pixels $wid [$wid cget -height]]
 		} else {
 		    set window_x [lindex $sc 2]
 		    set window_y [lindex $sc 3]
 		}
 	    } else {