]> git.mjollnir.org Git - moodle.git/commitdiff
No functional changes, just fixed comments to make the Moodle mods clearer.
authormartin <martin>
Sat, 1 Dec 2001 09:47:30 +0000 (09:47 +0000)
committermartin <martin>
Sat, 1 Dec 2001 09:47:30 +0000 (09:47 +0000)
lib/graphlib.php

index 8cfbee93f97aaa7b66a0acdfc5a7ff36c9d85917..8cc39b38cfda8aa537990a33af37fd9ce6531d5d 100644 (file)
@@ -22,6 +22,11 @@ Copy of GNU Lesser General Public License at: http://www.gnu.org/copyleft/lesser
 Contact author at: hermanV@mindless.com\r
 */\r
 \r
+/* This file contains modifications by Martin Dougiamas\r
+ * as part of Moodle (http://moodle.com).  Modified lines\r
+ * are marked with "Moodle".\r
+ */\r
+\r
 \r
 class graph {\r
   var $image;\r
@@ -141,7 +146,7 @@ class graph {
 // init all text - title, labels, and axis text.\r
 function init() {\r
   global $CFG;\r
-  $this->parameter['path_to_fonts'] = $CFG->dirroot."/lib/fonts/";  // Added for Moodle\r
+  $this->parameter['path_to_fonts'] = $CFG->dirroot."/lib/fonts/";  // Moodle\r
 \r
   $this->calculated['outer_border'] = $this->calculated['boundary_box'];\r
 \r
@@ -264,13 +269,13 @@ function draw_set($order, $set, $offset) {
     //print "$thisX, $thisY <BR>";\r
 \r
     if (($bar!='none') && (string)$thisY != 'none') {\r
-        // Moodle addition - next 5 lines and last parameter yoffset\r
-        if ($relatedset = $this->offset_relation[$set]) {\r
-            $yoffset = $this->calculated['y_plot'][$relatedset][$index];\r
-        } else {\r
-            $yoffset = 0;\r
-        }\r
-        $this->bar($thisX, $thisY, $bar, $barSize, $colour, $offset, $set, $yoffset);\r
+        if ($relatedset = $this->offset_relation[$set]) {                               // Moodle\r
+            $yoffset = $this->calculated['y_plot'][$relatedset][$index];                // Moodle\r
+        } else {                                                                        // Moodle\r
+            $yoffset = 0;                                                               // Moodle\r
+        }                                                                               // Moodle\r
+        //$this->bar($thisX, $thisY, $bar, $barSize, $colour, $offset, $set);           // Moodle\r
+        $this->bar($thisX, $thisY, $bar, $barSize, $colour, $offset, $set, $yoffset);   // Moodle\r
     }\r
 \r
     if (($area!='none') && (((string)$lastY != 'none') && ((string)$thisY != 'none')))\r
@@ -1539,11 +1544,11 @@ function bar($x, $y, $type, $size, $colour, $offset, $index, $yoffset) {
     $v       = $this->calculated['boundary_box']['bottom'] - $y + $offset;\r
 \r
     // Moodle addition, plus the function parameter yoffset\r
-    if ($yoffset) {\r
-        $yoffset = $yoffset - round(($bottom - $v) / 2.0);\r
-        $bottom -= $yoffset;\r
-        $v      -= $yoffset;\r
-    }\r
+    if ($yoffset) {                                           // Moodle\r
+        $yoffset = $yoffset - round(($bottom - $v) / 2.0);    // Moodle\r
+        $bottom -= $yoffset;                                  // Moodle\r
+        $v      -= $yoffset;                                  // Moodle\r
+    }                                                         // Moodle\r
 \r
     switch ($type) {\r
       case 'open':\r