Skip to content
Browse files

Resolving conflict in utils.js.

  • Loading branch information...
1 parent 19c4b1c commit 7b3515bcbe1ae28a5bc6331d87981d8a54dcf31f @ellisonbg committed
Showing with 12 additions and 0 deletions.
  1. +12 −0 IPython/frontend/html/notebook/static/js/utils.js
View
12 IPython/frontend/html/notebook/static/js/utils.js
@@ -126,12 +126,24 @@ IPython.utils = (function (IPython) {
DOWN : 40,
};
+
+ points_to_pixels = function (points) {
+ // A reasonably good way of converting between points and pixels.
+ var test = $('<div style="display: none; width: 10000pt; padding:0; border:0;"></div>');
+ $(body).append(test);
+ var pixel_per_point = test.width()/10000;
+ test.remove();
+ return Math.floor(points*pixel_per_point);
+ }
+
+
return {
uuid : uuid,
fixConsole : fixConsole,
keycodes : keycodes,
grow : grow,
fixCarriageReturn : fixCarriageReturn
+ points_to_pixels : points_to_pixels
};
}(IPython));

0 comments on commit 7b3515b

Please sign in to comment.
Something went wrong with that request. Please try again.