From aa5490d54a18eb7f3d05a0c03893ddf4a04d95d8 Mon Sep 17 00:00:00 2001
From: Ivica Ico Bukvic <ico@monsoon-hp.(none)>
Date: Sat, 3 Mar 2012 20:07:45 -0500
Subject: [PATCH] added hooks for zoom reset (ctrl+shift+return) in addition to
 the zooming (ctrl+wheel)

---
 src/pd.tk | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/pd.tk b/src/pd.tk
index ef40e30d6..ecdb1d07d 100644
--- a/src/pd.tk
+++ b/src/pd.tk
@@ -3242,6 +3242,7 @@ proc pdtk_canvas_ctrlkey {name key shift} {
         if {$key == "l" || $key == "L"} {menu_clear_console}
         if {$key == "r" || $key == "R"} {menu_toggle_console}
 		if {$key == "E"} {menu_tooltips $topname}
+		if {$key == "Return"} {pdtk_zoom_reset $topname}
 		if {!$ignore} {
 	        if {$key == "w" || $key == "W"} {menu_really_close $topname}
 	        if {$key == "s" || $key == "S"} {menu_saveas $topname}
@@ -3398,6 +3399,21 @@ proc pdtk_zoom {name direction} {
 set font_array { 8 10 12 16 24 36 }
 set zoom_fontsize 10
 
+proc pdtk_zoom_reset {name} {
+	global font_array
+	global zoom_fontsize
+
+	if { $zoom_fontsize == 10 } { return }
+	
+	if { $zoom_fontsize < 10 } {
+		pdtk_zoom $name 1
+	} else {
+		while { $zoom_fontsize != 10 } {
+			pdtk_zoom $name -1
+		}
+	}
+}
+
 proc pdtk_zoom {name direction} {
 	global font_array
 	global zoom_fontsize
-- 
GitLab