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

Author: Lars Michelsen <[email protected]>
Date:   Wed Sep 23 21:43:52 2009 +0200

#99 z-index is being ignored on initial line rendering - fixed for canvas 
rendering mode (used in e.g. firefox); Problem still exists in IE

---

 .../frontend/nagvis-js/js/NagVisStatefulObject.js  |    2 +-
 share/frontend/nagvis-js/js/lines.js               |   12 +++++++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/share/frontend/nagvis-js/js/NagVisStatefulObject.js 
b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
index 55ed907..2d8cff5 100755
--- a/share/frontend/nagvis-js/js/NagVisStatefulObject.js
+++ b/share/frontend/nagvis-js/js/NagVisStatefulObject.js
@@ -394,7 +394,7 @@ var NagVisStatefulObject = NagVisObject.extend({
                var width = this.conf.line_width;
                
                // Parse the line object
-               drawNagVisLine(this.conf.object_id, this.conf.line_type, x[0], 
y[0], x[1], y[1], width, this.conf.summary_state, 
this.conf.summary_problem_has_been_acknowledged, this.conf.summary_in_downtime, 
((this.conf.url && this.conf.url !== '') || (this.conf.hover_menu && 
this.conf.hover_menu !== '')));
+               drawNagVisLine(this.conf.object_id, this.conf.line_type, x[0], 
y[0], x[1], y[1], this.conf.z, width, this.conf.summary_state, 
this.conf.summary_problem_has_been_acknowledged, this.conf.summary_in_downtime, 
((this.conf.url && this.conf.url !== '') || (this.conf.hover_menu && 
this.conf.hover_menu !== '')));
        },
        
        /**
diff --git a/share/frontend/nagvis-js/js/lines.js 
b/share/frontend/nagvis-js/js/lines.js
index 545aed8..babcf41 100755
--- a/share/frontend/nagvis-js/js/lines.js
+++ b/share/frontend/nagvis-js/js/lines.js
@@ -65,7 +65,7 @@ function newY(a, b, x, y) {
 }
 
 // This function draws an arrow like it is used on NagVis maps
-function drawArrow(objectId, x1, y1, x2, y2, w, colorFill, colorBorder, 
bLinkArea) {
+function drawArrow(objectId, x1, y1, x2, y2, z, w, colorFill, colorBorder, 
bLinkArea) {
        var xCoord = [];
        var yCoord = [];
        
@@ -101,6 +101,7 @@ function drawArrow(objectId, x1, y1, x2, y2, w, colorFill, 
colorBorder, bLinkAre
                oCanvas.style.top = yMin+"px";
                oCanvas.width = Math.round(xMax-xMin);
                oCanvas.height = Math.round(yMax-yMin);
+               oCanvas.style.zIndex = z;
                
                var ctx = oCanvas.getContext('2d');
                
@@ -146,6 +147,7 @@ function drawArrow(objectId, x1, y1, x2, y2, w, colorFill, 
colorBorder, bLinkAre
                oImg.style.position = 'absolute';
                oImg.style.left = (middle(x1, x2)-10)+"px";
                oImg.style.top = (middle(y1, y2)-10)+"px";
+               oImg.style.zIndex = z+1;
                
                oLinkContainer.appendChild(oImg);
                oImg = null;
@@ -154,7 +156,7 @@ function drawArrow(objectId, x1, y1, x2, y2, w, colorFill, 
colorBorder, bLinkAre
 }
 
 // This function is being called by NagVis for drawing the lines
-function drawNagVisLine(objectId, type, x1, y1, x2, y2, width, state, ack, 
downtime, bLinkArea) {
+function drawNagVisLine(objectId, type, x1, y1, x2, y2, z, width, state, ack, 
downtime, bLinkArea) {
        var colorFill = '';
        var colorBorder = '#000000';
        
@@ -196,9 +198,9 @@ function drawNagVisLine(objectId, type, x1, y1, x2, y2, 
width, state, ack, downt
                var xMid = middle(x1,x2);
                var yMid = middle(y1,y2);
                
-               drawArrow(objectId, x1, y1, xMid, yMid, width, colorFill, 
colorBorder, bLinkArea);
-               drawArrow(objectId, x2, y2, xMid, yMid, width, colorFill, 
colorBorder, bLinkArea);
+               drawArrow(objectId, x1, y1, xMid, yMid, z, width, colorFill, 
colorBorder, bLinkArea);
+               drawArrow(objectId, x2, y2, xMid, yMid, z, width, colorFill, 
colorBorder, bLinkArea);
        } else if(type == 11) {
-               drawArrow(objectId, x1, y1, x2, y2, width, colorFill, 
colorBorder, bLinkArea);
+               drawArrow(objectId, x1, y1, x2, y2, z, width, colorFill, 
colorBorder, bLinkArea);
        }
 }


------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to