Hi,

PFA patch to fix the following issues,

1) Node label alignment issue in Sub-plans if the database object has long
name.
RM#2843

2) Node label not displaying properly if the database object has long name.
RM#2842

3) Node label was incorrect if we run "Explain Analyze" on a query that
invokes a function.
RM#2824

Please review.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/misc/static/explain/js/explain.js 
b/web/pgadmin/misc/static/explain/js/explain.js
index 9eeaa70..d9dc7f5 100644
--- a/web/pgadmin/misc/static/explain/js/explain.js
+++ b/web/pgadmin/misc/static/explain/js/explain.js
@@ -64,7 +64,7 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
           );
 
       if (curr_line) {
-        lines = lines.slice(0, lines.length - 2);
+        lines = lines.slice(0, lines.length - 1);
       }
       lines = lines.concat(tmpArr);
       curr_line = lines[lines.length - 1];
@@ -376,9 +376,10 @@ var PlanModel = Backbone.Model.extend({
         if (isSubPlan) {
           g.rect(
             currentXpos - this.get('width') + pWIDTH + xMargin,
-            currentYpos - yMargin,
+            currentYpos - this.get('height') + pHEIGHT + yMargin - TXT_ALLIGN,
             this.get('width') - xMargin,
-            this.get('height'), 5
+            this.get('height') + (currentYpos - yMargin),
+            5
           ).attr({
               stroke: '#444444',
               'strokeWidth': 1.2,
@@ -461,7 +462,7 @@ var PlanModel = Backbone.Model.extend({
                             this.get('Schema')+"."+this.get('image_text'));
         var label = g.g();
         g.multitext(
-          currentXpos + (pWIDTH / 2),
+          currentXpos + (pWIDTH / 2) + TXT_ALLIGN,
           currentYpos + pHEIGHT - TXT_ALLIGN,
           node_label,
           150,
@@ -531,7 +532,7 @@ var MainPlanModel = Backbone.Model.extend({
            data['xpos'] = 0;
            data['ypos'] = 0;
            data['width'] = plan.get('width') + (xMargin * 2);
-           data['height'] = plan.get('height') + (yMargin * 2);
+           data['height'] = plan.get('height') + (yMargin * 4);
 
            delete data['Plan'];
         }

Reply via email to