From f7bc22e0b4b828ec43dd0ab64cb0201249cf3474 Mon Sep 17 00:00:00 2001 From: "blakeross%telocity.com" Date: Fri, 5 Jan 2001 23:06:09 +0000 Subject: [PATCH] Fix 54963: mousewheel text sizing not bounded, and lower upper bound (to 2000%). patch by Jonas Sicking (sicking@bigfoot.com). r=bryner,blake a=ben --- content/events/src/nsEventStateManager.cpp | 4 +++- layout/events/src/nsEventStateManager.cpp | 4 +++- xpfe/browser/resources/content/navigator.js | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index c816bacaf30c..5bd4a9c52bf1 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -802,7 +802,9 @@ nsEventStateManager::ChangeTextSize(PRInt32 change) float textzoom; mv->GetTextZoom(&textzoom); - mv->SetTextZoom(textzoom + 0.1*change); + textzoom += 0.1*change; + if (textzoom > 0 && textzoom <= 20) + mv->SetTextZoom(textzoom); return NS_OK; } diff --git a/layout/events/src/nsEventStateManager.cpp b/layout/events/src/nsEventStateManager.cpp index c816bacaf30c..5bd4a9c52bf1 100644 --- a/layout/events/src/nsEventStateManager.cpp +++ b/layout/events/src/nsEventStateManager.cpp @@ -802,7 +802,9 @@ nsEventStateManager::ChangeTextSize(PRInt32 change) float textzoom; mv->GetTextZoom(&textzoom); - mv->SetTextZoom(textzoom + 0.1*change); + textzoom += 0.1*change; + if (textzoom > 0 && textzoom <= 20) + mv->SetTextZoom(textzoom); return NS_OK; } diff --git a/xpfe/browser/resources/content/navigator.js b/xpfe/browser/resources/content/navigator.js index 287407217f42..7632ca6781fa 100644 --- a/xpfe/browser/resources/content/navigator.js +++ b/xpfe/browser/resources/content/navigator.js @@ -969,7 +969,7 @@ function BrowserPrint() function setTextZoomOther() { // open dialog and ask for new value - var o = { retvals: {zoom: zoomOther}, zoomMin: 1, zoomMax: 5000 }; + var o = { retvals: {zoom: zoomOther}, zoomMin: 1, zoomMax: 2000 }; window.openDialog( "chrome://navigator/content/askViewZoom.xul", "", "chrome,modal,titlebar", o); if (o.retvals.zoomOK) { zoomOther = o.retvals.zoom;