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

Unified Diff: remoting/webapp/client_plugin_async.js

Issue 66673007: Ensure that dimensions and DPI are integers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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: remoting/webapp/client_plugin_async.js
diff --git a/remoting/webapp/client_plugin_async.js b/remoting/webapp/client_plugin_async.js
index 7aa255aa464959f74b6c92ba5a144ee76cb7fd95..3e0461fd41b70eef35f45951dff8411def826155 100644
--- a/remoting/webapp/client_plugin_async.js
+++ b/remoting/webapp/client_plugin_async.js
@@ -524,11 +524,11 @@ remoting.ClientPluginAsync.prototype.sendClipboardItem =
remoting.ClientPluginAsync.prototype.notifyClientResolution =
function(width, height, device_scale) {
if (this.hasFeature(remoting.ClientPlugin.Feature.NOTIFY_CLIENT_RESOLUTION)) {
- var dpi = device_scale * 96;
+ var dpi = Math.floor(device_scale * 96);
this.plugin.postMessage(JSON.stringify(
{ method: 'notifyClientResolution',
- data: { width: width * device_scale,
- height: height * device_scale,
+ data: { width: Math.floor(width * device_scale),
+ height: Math.floor(height * device_scale),
Lambros 2013/11/08 22:26:33 Math.round might be slightly better?
Jamie 2013/11/08 22:29:15 I think we want floor. A 1px border is better than
x_dpi: dpi, y_dpi: dpi }}));
}
};
« 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