Show More
@@ -126,12 +126,24 b' IPython.utils = (function (IPython) {' | |||||
126 | DOWN : 40, |
|
126 | DOWN : 40, | |
127 | }; |
|
127 | }; | |
128 |
|
128 | |||
|
129 | ||||
|
130 | points_to_pixels = function (points) { | |||
|
131 | // A reasonably good way of converting between points and pixels. | |||
|
132 | var test = $('<div style="display: none; width: 10000pt; padding:0; border:0;"></div>'); | |||
|
133 | $(body).append(test); | |||
|
134 | var pixel_per_point = test.width()/10000; | |||
|
135 | test.remove(); | |||
|
136 | return Math.floor(points*pixel_per_point); | |||
|
137 | } | |||
|
138 | ||||
|
139 | ||||
129 | return { |
|
140 | return { | |
130 | uuid : uuid, |
|
141 | uuid : uuid, | |
131 | fixConsole : fixConsole, |
|
142 | fixConsole : fixConsole, | |
132 | keycodes : keycodes, |
|
143 | keycodes : keycodes, | |
133 | grow : grow, |
|
144 | grow : grow, | |
134 | fixCarriageReturn : fixCarriageReturn |
|
145 | fixCarriageReturn : fixCarriageReturn | |
|
146 | points_to_pixels : points_to_pixels | |||
135 | }; |
|
147 | }; | |
136 |
|
148 | |||
137 | }(IPython)); |
|
149 | }(IPython)); |
General Comments 0
You need to be logged in to leave comments.
Login now