diff options
author | BlueRaja <BlueRaja.admin@gmail.com> | 2013-03-08 05:04:00 -0600 |
---|---|---|
committer | BlueRaja <BlueRaja.admin@gmail.com> | 2013-03-08 05:04:00 -0600 |
commit | 054c81263351d02a3cea33339d850bb0ecfb363f (patch) | |
tree | 9e52ee53e7c8979ecb4148f61497505111c51343 /js/mapspecs.js | |
parent | 312c4362e9deed7ed7573e17312c1669cc5e9e65 (diff) | |
download | pathery-054c81263351d02a3cea33339d850bb0ecfb363f.tar.xz |
Fix width issue when displaying maps
Diffstat (limited to 'js/mapspecs.js')
-rw-r--r-- | js/mapspecs.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/js/mapspecs.js b/js/mapspecs.js index 7c74a92..3e649fd 100644 --- a/js/mapspecs.js +++ b/js/mapspecs.js @@ -850,8 +850,18 @@ function mapAsHTML(map, targetWidth, mapEditor) { //console.log("MapObj", map);
mapdata[map.ID] = map;
- if ((map.width * 35) <= targetWidth) targetWidth = (map.width * 35);
- if (!targetWidth) targetWidth = (map.width * 35);
+ if (!targetWidth || (map.width * 35) <= targetWidth)
+ {
+ targetWidth = (map.width * 35);
+ }
+ else
+ {
+ //Need to take into account padding of .grid_outer
+ var fakeGridDom = $('<div class="grid_outer"></div>');
+ var gridOuterPadding = parseInt(fakeGridDom.css('padding-left')) + parseInt(fakeGridDom.css('padding-right'));
+ targetWidth -= gridOuterPadding;
+ }
+
var scale = map.width / targetWidth;
//alert(scale);
|