Author: Lars Michelsen <[email protected]>
Date: Sat Apr 16 15:04:39 2011 +0200
Committer: Lars Michelsen <[email protected]>
Commit-Date: Sat Apr 16 15:04:39 2011 +0200
Fixed problem redrawing the lines while dragging
---
share/frontend/nagvis-js/js/lines.js | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/share/frontend/nagvis-js/js/lines.js
b/share/frontend/nagvis-js/js/lines.js
index 97a54fc..1416558 100644
--- a/share/frontend/nagvis-js/js/lines.js
+++ b/share/frontend/nagvis-js/js/lines.js
@@ -85,11 +85,12 @@ function drawPolygonBasedObject(objectId, num, xCoord,
yCoord, z, colorFill, col
oCanvas.style.position = 'absolute';
oCanvas.style.left = xMin+"px";
oCanvas.style.top = yMin+"px";
- oCanvas.width = Math.round(xMax-xMin) + 'px';
- oCanvas.height = Math.round(yMax-yMin) + 'px';
+ oCanvas.width = Math.round(xMax-xMin);
+ oCanvas.height = Math.round(yMax-yMin);
oCanvas.style.zIndex = z;
var ctx = oCanvas.getContext('2d');
+ ctx.clearRect(0, 0, oCanvas.width, oCanvas.height);
ctx.fillStyle = colorFill;
ctx.beginPath();
@@ -101,13 +102,15 @@ function drawPolygonBasedObject(objectId, num, xCoord,
yCoord, z, colorFill, col
}
ctx.fill();
+ ctx = null;
- var oLineContainer = document.getElementById(objectId+'-line');
- if(oLineContainer)
+ if(!isset(oCanvas.parentNode)) {
+ var oLineContainer =
document.getElementById(objectId+'-line');
+ if(oLineContainer)
oLineContainer.appendChild(oCanvas);
- ctx = null;
+ oLineContainer = null;
+ }
oCanvas = null;
- oLineContainer = null;
} else {
// Fallback to old line style
var oLine = new
jsGraphics(document.getElementById(objectId+'-line'));
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins