From: Ariel G. <ag...@us...> - 2001-11-30 19:24:50
|
Update of /cvsroot/vagrant/vagrant-2.5 In directory usw-pr-cvs1:/tmp/cvs-serv2970 Modified Files: ImagePrimitives.class Log Message: Highlights could be added outside of a graphs drawable extents. This caused bad results so now highlights are checked for drawability. if they are not drawable, they are marked as such so that they don't show up in the legend. Index: ImagePrimitives.class =================================================================== RCS file: /cvsroot/vagrant/vagrant-2.5/ImagePrimitives.class,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ImagePrimitives.class 2001/11/29 23:34:28 1.3 --- ImagePrimitives.class 2001/11/30 19:24:47 1.4 *************** *** 39,44 **** */ function InitializePrimitives() { ! $this->text_size = $this->image_object->GetTextSize('M',TEXT_HORIZONTAL); ! $this->highlights = array(); $this->DEFAULTS = array(); --- 39,45 ---- */ function InitializePrimitives() { ! $this->text_size = $this->image_object->GetTextSize('M',TEXT_HORIZONTAL); ! $this->highlights = array(); ! $this->drawn_highlights = array(); // Since you can change the extents of a graph, it is possible for the highlights to not be drawable $this->DEFAULTS = array(); *************** *** 396,400 **** } // if the x_min is not numerical, make it min of the graph else { ! $x_min = &$this->highlights[$highlight_id]['x_min']; } // else just point to the specified x_min --- 397,401 ---- } // if the x_min is not numerical, make it min of the graph else { ! $x_min = max(&$this->highlights[$highlight_id]['x_min'], $this->GetValue('x_min')); } // else just point to the specified x_min *************** *** 403,407 **** } // if the x_max is not numerical, make it max of the graph else { ! $x_max = &$this->highlights[$highlight_id]['x_max']; } // else just point to the specified x_min --- 404,408 ---- } // if the x_max is not numerical, make it max of the graph else { ! $x_max = min(&$this->highlights[$highlight_id]['x_max'], $this->GetValue('x_max')); } // else just point to the specified x_min *************** *** 410,414 **** } // if the y_min is not numerical, make it min of the graph else { ! $y_min = &$this->highlights[$highlight_id]['y_min']; } // else just point to the specified y_min --- 411,415 ---- } // if the y_min is not numerical, make it min of the graph else { ! $y_min = max($this->highlights[$highlight_id]['y_min'], $this->GetValue($axis_min)); } // else just point to the specified y_min *************** *** 417,423 **** } // if the y_max is not numerical, make it max of the graph else { ! $y_max = &$this->highlights[$highlight_id]['y_max']; } // else just point to the specified y_max $this->GetImageLocation($x_min, $y_min, $x_min_pos, $y_min_pos, $this->highlights[$highlight_id]['axis2']); $this->GetImageLocation($x_max, $y_max, $x_max_pos, $y_max_pos, $this->highlights[$highlight_id]['axis2']); --- 418,432 ---- } // if the y_max is not numerical, make it max of the graph else { ! $y_max = min($this->highlights[$highlight_id]['y_max'], $this->GetValue($axis_max)); } // else just point to the specified y_max + if ((!$y_min >= $this->GetValue($axis_max)) || ($y_max <= $this->GetValue($axis_min)) || ($x_min >= $this->GetValue('x_max')) || ($x_max <= $this->GetValue('x_min'))) { + $this->drawn_highlights[$highlight_id] = false; + return false; + } // if the extents of this are are not visible to the user + else { + $this->drawn_highlights[$highlight_id] = true; + } // else we can draw this correctly + $this->GetImageLocation($x_min, $y_min, $x_min_pos, $y_min_pos, $this->highlights[$highlight_id]['axis2']); $this->GetImageLocation($x_max, $y_max, $x_max_pos, $y_max_pos, $this->highlights[$highlight_id]['axis2']); *************** *** 1140,1144 **** reset($this->highlights); while (list($highlight_id,) = @each($this->highlights)) { ! if (!$this->highlights[$highlight_id]['options']['legend_text']) { continue; } // if this is not a real dataset for this object, skip it --- 1149,1156 ---- reset($this->highlights); while (list($highlight_id,) = @each($this->highlights)) { ! if ((!$this->highlights[$highlight_id]['options']['legend_text']) || !$this->drawn_highlights[$highlight_id]) { ! if ($this->highlights[$highlight_id]['options']['legend_text']) { ! print_r($this->drawn_highlights);die(); ! } continue; } // if this is not a real dataset for this object, skip it |