Module: nagvis
Branch: master
Commit: e415daf9b8e0d31161d8265f30507810e3a04cce
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=e415daf9b8e0d31161d8265f30507810e3a04cce

Author: Lars Michelsen <[email protected]>
Date:   Tue Feb  1 23:05:17 2011 +0100

Fixed dragging relative labels of line objects in WUI

---

 share/frontend/wui/js/wui.js |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/share/frontend/wui/js/wui.js b/share/frontend/wui/js/wui.js
index fa99de8..2a32300 100644
--- a/share/frontend/wui/js/wui.js
+++ b/share/frontend/wui/js/wui.js
@@ -392,10 +392,18 @@ function saveObjectAfterMoveAndDrop(oObj) {
                
                // Handle relative and absolute aligned labels
                if(align === 'rel') {
-                       // Calculate relative coordinates
-                       var objX = 
pxToInt(document.getElementById('box_'+type+'_'+id).style.left);
-                       var objY = 
pxToInt(document.getElementById('box_'+type+'_'+id).style.top);
-                       
+                       var objX, objY;
+                       var oLine = 
document.getElementById('line_'+type+'_'+id);
+                       if(oLine) {
+                               objX = 
document.getElementById('line_'+type+'_'+id).startX;
+                               objY = 
document.getElementById('line_'+type+'_'+id).startY;
+                               oLine = null;
+                       } else {        
+                               // Calculate relative coordinates
+                               objX = 
pxToInt(document.getElementById('box_'+type+'_'+id).style.left);
+                               objY = 
pxToInt(document.getElementById('box_'+type+'_'+id).style.top);
+                       }
+
                        // +3: Is the borderWidth of the object highlighting.
                        // The header menu height is not needed when 
calculating relative coords
                        x = oObj.x - objX + borderWidth;


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to