Revision: 2096
          http://mrbs.svn.sourceforge.net/mrbs/?rev=2096&view=rev
Author:   cimorrison
Date:     2011-10-15 10:11:49 +0000 (Sat, 15 Oct 2011)
Log Message:
-----------
Better fix for spurious overlaps

Modified Paths:
--------------
    mrbs/branches/draggable_bookings/web/Themes/default/header.inc

Modified: mrbs/branches/draggable_bookings/web/Themes/default/header.inc
===================================================================
--- mrbs/branches/draggable_bookings/web/Themes/default/header.inc      
2011-10-15 09:56:33 UTC (rev 2095)
+++ mrbs/branches/draggable_bookings/web/Themes/default/header.inc      
2011-10-15 10:11:49 UTC (rev 2096)
@@ -1252,14 +1252,16 @@
     {
       <?php
       // Get the sides of the rectangle represented by the jQuery object 
jqObject
+      // We round down the size of the rectangle to avoid any spurious overlaps
+      // caused by rounding errors
       ?>
       function getSides(jqObject)
       {
         var sides = {};
-        sides.n = jqObject.offset().top;
-        sides.w = jqObject.offset().left;
-        sides.s = sides.n + jqObject.outerHeight();
-        sides.e = sides.w + jqObject.outerWidth();
+        sides.n = Math.ceil(jqObject.offset().top);
+        sides.w = Math.ceil(jqObject.offset().left);
+        sides.s = Math.floor(sides.n + jqObject.outerHeight());
+        sides.e = Math.floor(sides.w + jqObject.outerWidth());
         return sides;
       }
       
@@ -1301,7 +1303,7 @@
           {
             tableData.x.key = getDataName($(this));
           }
-          tableData.x.data.push({coord: Math.round($(this).offset().left),
+          tableData.x.data.push({coord: $(this).offset().left,
                                  value: $(this).data(tableData.x.key)});
         });
       <?php 
@@ -1315,7 +1317,7 @@
             value = tableData.x.data[tableData.x.data.length - 1].value +
                     tableData.x.data[1].value - tableData.x.data[0].value;
           }
-          tableData.x.data.push({coord: Math.round($(this).offset().left + 
$(this).outerWidth()),
+          tableData.x.data.push({coord: $(this).offset().left + 
$(this).outerWidth(),
                                  value: value});
         });
 
@@ -1327,7 +1329,7 @@
           {
             tableData.y.key = getDataName($(this));
           }
-          tableData.y.data.push({coord: Math.round($(this).offset().top),
+          tableData.y.data.push({coord: $(this).offset().top,
                                  value: $(this).data(tableData.y.key)});
         });
       <?php // and also get the bottom edge ?>
@@ -1338,7 +1340,7 @@
             value = tableData.y.data[tableData.y.data.length - 1].value + 
                     tableData.y.data[1].value - tableData.y.data[0].value;
           }
-          tableData.y.data.push({coord: Math.round($(this).offset().top + 
$(this).outerHeight()),
+          tableData.y.data.push({coord: $(this).offset().top + 
$(this).outerHeight(),
                                  value: value});
         });
      

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to