Module: nagvis Branch: master Commit: df797ce42df3efbb2b7cac70676278372195a2ac URL: http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=df797ce42df3efbb2b7cac70676278372195a2ac
Author: Lars Michelsen <[email protected]> Date: Fri Nov 19 08:51:02 2010 +0100 WUI: Fixed reposition effect when adding borders to objects while hovering over a line Conflicts: ChangeLog --- share/frontend/wui/classes/WuiMap.php | 4 ++-- share/frontend/wui/js/wui.js | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/share/frontend/wui/classes/WuiMap.php b/share/frontend/wui/classes/WuiMap.php index 440fa17..fe3ff3d 100644 --- a/share/frontend/wui/classes/WuiMap.php +++ b/share/frontend/wui/classes/WuiMap.php @@ -302,13 +302,13 @@ class WuiMap extends GlobalMap { $y = $y1; } - $ret .= "var ".$lineId." = new jsGraphics('box_".$obj['type']."_".$obj['id']."');"; + $ret .= "var ".$lineId." = new jsGraphics('line_".$obj['type']."_".$obj['id']."');"; $ret .= $lineId.".setColor('#FF0000');"; $ret .= $lineId.".setStroke(1);"; $ret .= $lineId.".drawLine(".($x1-$x).",".($y1-$y).",".($x2-$x).",".($y2-$y).");"; $ret .= $lineId.".paint();"; - return $this->parseJs($ret); + return '<div style="position:absolute;top:0px;left:0px" id="line_'.$obj['type'].'_'.$obj['id'].'"></div>'.$this->parseJs($ret); } /** diff --git a/share/frontend/wui/js/wui.js b/share/frontend/wui/js/wui.js index b4d49c0..46fcef7 100644 --- a/share/frontend/wui/js/wui.js +++ b/share/frontend/wui/js/wui.js @@ -701,16 +701,32 @@ function toggleBorder(oObj, state){ var top = parseInt(oContainer.style.top.replace('px', '')); var left = parseInt(oContainer.style.left.replace('px', '')); + var parts = oObj.id.split('_'); + var type = parts[1]; + var id = parts[2]; + var oLine = document.getElementById('line_'+type+'_'+id); + if(state === 1) { oObj.style.border = iWidth + "px solid " + sColor; - oContainer.style.top = (top - iWidth) + 'px'; + oContainer.style.top = (top - iWidth) + 'px'; oContainer.style.left = (left - iWidth) + 'px'; + + if(oLine) { + oLine.style.top = iWidth + 'px'; + oLine.style.left = iWidth + 'px'; + } } else { oObj.style.border = "none"; oContainer.style.top = (top + iWidth) + 'px'; oContainer.style.left = (left + iWidth) + 'px'; + + if(oLine) { + oLine.style.top = '0px'; + oLine.style.left = '0px'; + } } + oLine = null; oObj = null; oContainer = null; } ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Nagvis-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nagvis-checkins
