jablonka.czprosek.czf

weathermap

Subversion Repositories:
[/] [Weathermap.class.php] - Diff between revs 2 and 11

Show entire file Ignore whitespace

Rev 2 Rev 11
Line 1218... Line 1218...
   
} }
   
// debug("Choosing NODE BGCOLOR for ".$this->name." based on $pc %\n"); // debug("Choosing NODE BGCOLOR for ".$this->name." based on $pc %\n");
   
list($col,$node_scalekey) = $map->ColourFromPercent($pc, $this->usescale); list($col,$node_scalekey) = $map->ColourFromPercent($pc, $this->usescale, $this->name);
// $map->nodes[$this->name]->scalekey = $node_scalekey; // $map->nodes[$this->name]->scalekey = $node_scalekey;
} }
elseif($this->labelbgcolour != array(-1,-1,-1)) elseif($this->labelbgcolour != array(-1,-1,-1))
{ {
$col=myimagecolorallocate($node_im, $this->labelbgcolour[0], $this->labelbgcolour[1], $this->labelbgcolour[2]); $col=myimagecolorallocate($node_im, $this->labelbgcolour[0], $this->labelbgcolour[1], $this->labelbgcolour[2]);
Line 1937... Line 1937...
} }
   
$xpoints[]=$x2; $xpoints[]=$x2;
$ypoints[]=$y2; $ypoints[]=$y2;
   
list($link_in_colour,$link_in_scalekey) = $map->ColourFromPercent($this->inpercent,$this->usescale); list($link_in_colour,$link_in_scalekey) = $map->ColourFromPercent($this->inpercent,$this->usescale, $this->name);
list($link_out_colour,$link_out_scalekey) = $map->ColourFromPercent($this->outpercent,$this->usescale); list($link_out_colour,$link_out_scalekey) = $map->ColourFromPercent($this->outpercent,$this->usescale, $this->name);
   
// $map->links[$this->name]->inscalekey = $link_in_scalekey; // $map->links[$this->name]->inscalekey = $link_in_scalekey;
// $map->links[$this->name]->outscalekey = $link_out_scalekey; // $map->links[$this->name]->outscalekey = $link_out_scalekey;
   
$link_width=$this->width; $link_width=$this->width;
Line 2855... Line 2855...
   
$this->imap->addArea("Rectangle", "LINK:".$linkname, '', array($x1, $y1, $x2, $y2)); $this->imap->addArea("Rectangle", "LINK:".$linkname, '', array($x1, $y1, $x2, $y2));
   
} }
   
function ColourFromPercent($percent,$scalename="DEFAULT") function ColourFromPercent($percent,$scalename="DEFAULT",$name="")
{ {
$col = NULL; $col = NULL;
   
if(isset($this->colours[$scalename])) if(isset($this->colours[$scalename]))
{ {
$colours=$this->colours[$scalename]; $colours=$this->colours[$scalename];
   
if ($percent > 100) if ($percent > 100)
{ {
warn ("ColourFromPercent: Clipped $percent% to 100%\n"); warn ("ColourFromPercent: Clipped $name $percent% to 100%\n");
$percent=100; $percent=100;
} }
   
foreach ($colours as $key => $colour) foreach ($colours as $key => $colour)
{ {

Powered by WebSVN 2.2.1