From a5e0de031cc425dd4f6015d30bdf5b183fa69392 Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Tue, 6 Apr 2021 22:04:53 -0400 Subject: [PATCH] Corrected the "font measure" line in the wrapper Tcl code from revision 131, as a Tk default font size less than 10 will round the scaling factor down to zero and result in bad things happening. --- tcltk/wrapper.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcltk/wrapper.tcl b/tcltk/wrapper.tcl index 4b327c80..f8c3056f 100644 --- a/tcltk/wrapper.tcl +++ b/tcltk/wrapper.tcl @@ -1138,10 +1138,10 @@ proc magic::openwrapper {{cell ""} {framename ""}} { # set. On standard displays, an "M" in the Sans font is usually 10 # pixels wide, and 22 on high resolution displays, so this maps to # a scale of 1 on standard displays and a scale of 2 on high resolution - # displays. + # displays. Make sure scale doesn't go to zero or bad things happen. if [catch {set Opts(scale)}] { - set Opts(scale) [expr {int([font measure TkDefaultFont M] / 10)}] + set Opts(scale) [expr {max(1, int([font measure TkDefaultFont M] / 10))}] } # Resize the window