Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Unified Diff: webkit/plugins/ppapi/ppapi_plugin_instance.cc

Issue 8784008: PPAPI: Don't round zoom levels to the nearest integer. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
===================================================================
--- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 112749)
+++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy)
@@ -1846,18 +1846,7 @@
// plugin. If we're in an iframe, then don't do anything.
if (!IsFullPagePlugin())
return;
-
- double zoom_level = WebView::zoomFactorToZoomLevel(factor);
- // The conversino from zoom level to factor, and back, can introduce rounding
- // errors. i.e. WebKit originally tells us 3.0, but by the time we tell the
- // plugin and it tells us back, the level becomes 3.000000000004. Need to
- // round or else otherwise if the user zooms out, it will go to 3.0 instead of
- // 2.0.
- int rounded =
- static_cast<int>(zoom_level + (zoom_level > 0 ? 0.001 : -0.001));
- if (abs(rounded - zoom_level) < 0.001)
- zoom_level = rounded;
- container()->zoomLevelChanged(zoom_level);
+ container()->zoomLevelChanged(WebView::zoomFactorToZoomLevel(factor));
}
void PluginInstance::ZoomLimitsChanged(PP_Instance instance,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698