Skip to content

Commit

Permalink
patch comments style made more consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
f1mishutka committed May 31, 2023
1 parent 7163de2 commit 891f7c7
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 17 deletions.
10 changes: 5 additions & 5 deletions src/lib/gd_image.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,13 +663,13 @@ function _StrokeBuiltinFont($x,$y,$txt,$dir,$paragraph_align,&$aBoundingBox,$aDe
for($i=0; $i < count($tmp); ++$i) {
$w1 = $this->GetTextWidth($tmp[$i]);
if( $paragraph_align=="left" ) {
imagestring($this->img,$use_font,(int)$x,(int)($y-$h+1+$i*$fh),$tmp[$i],$this->current_color);
imagestring($this->img,$use_font,(int)$x,(int)($y-$h+1+$i*$fh),$tmp[$i],$this->current_color); // MiTo Team: explicit type casting
}
elseif( $paragraph_align=="right" ) {
imagestring($this->img,$use_font,(int)($x+($w-$w1)),(int)($y-$h+1+$i*$fh),$tmp[$i],$this->current_color);
imagestring($this->img,$use_font,(int)($x+($w-$w1)),(int)($y-$h+1+$i*$fh),$tmp[$i],$this->current_color); // MiTo Team: explicit type casting
}
else {
imagestring($this->img,$use_font,(int)($x+$w/2-$w1/2),(int)($y-$h+1+$i*$fh),$tmp[$i],$this->current_color);
imagestring($this->img,$use_font,(int)($x+$w/2-$w1/2),(int)($y-$h+1+$i*$fh),$tmp[$i],$this->current_color); // MiTo Team: explicit type casting
}
}
}
Expand Down Expand Up @@ -1230,13 +1230,13 @@ function Ellipse($xc,$yc,$w,$h) {
}

function Circle($xc,$yc,$r) {
imageellipse($this->img,round($xc),round($yc),(float)$r*2,(float)$r*2,$this->current_color); //mitoteam: typecast added
imageellipse($this->img,round($xc),round($yc),(float)$r*2,(float)$r*2,$this->current_color); // MiTo Team: explicit type casting
// $this->DrawImageSmoothArc($this->img,round($xc),round($yc),$r*2+1,$r*2+1,0,360,$this->current_color);
// $this->imageSmoothCircle($this->img, round($xc),round($yc), $r*2+1, $this->current_color);
}

function FilledCircle($xc,$yc,$r) {
imagefilledellipse($this->img,round($xc),round($yc),2*(float)$r,2*(float)$r,$this->current_color); //mitoteam: typecast added
imagefilledellipse($this->img,round($xc),round($yc),2*(float)$r,2*(float)$r,$this->current_color); // MiTo Team: explicit type casting
// $this->DrawImageSmoothArc($this->img, round($xc), round($yc), 2*$r, 2*$r, 0, 360, $this->current_color);
}

Expand Down
4 changes: 2 additions & 2 deletions src/lib/jpgraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -4065,7 +4065,7 @@ function StrokeLabels($aPos,$aMinor=false,$aAbsLabel=false) {
// specified any values we use whats in the automatically asigned
// labels in the maj_ticks_label
if( isset($this->ticks_label[$i *(int)$m]) ) {
$label=$this->ticks_label[$i*(int)$m]; //mitoteam: typecast added
$label=$this->ticks_label[$i*(int)$m]; // MiTo Team: explicit type casting
}
else {
if( $aAbsLabel ) {
Expand Down Expand Up @@ -4174,7 +4174,7 @@ class Ticks {
$ticks_pos = array(), $maj_ticks_label = array();
public $precision;

public $ticks_label = array(); /* mitoteam: absent in original sources */
public $ticks_label = array(); // MiTo Team: explicit class member declared

protected $minor_abs_size=3, $major_abs_size=5;
protected $scale;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/jpgraph_bar.php
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ function Max() {
$y=0;
if( !isset($this->plots[0]->coords[0][$i]) ) {
if(mitoteam\jpgraph\MtJpGraph::isExtendedMode()) {
continue; // MiToTeam: ignore different number of datapoints
continue; // MiTo Team: ignore different number of datapoints
} else {
JpGraphError::RaiseL(2014);
}
Expand All @@ -854,7 +854,7 @@ function Max() {
for( $j = 1; $j < $this->nbrplots; $j++ ) {
if( !isset($this->plots[$j]->coords[0][$i]) ) {
if(mitoteam\jpgraph\MtJpGraph::isExtendedMode()) {
continue; // MiToTeam: ignore different number of datapoints
continue; // MiTo Team: ignore different number of datapoints
} else {
JpGraphError::RaiseL(2014);
}
Expand Down
5 changes: 3 additions & 2 deletions src/lib/jpgraph_contour.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Contour {
private $invert = true;
private $highcontrast = false, $highcontrastbw = false;

private $edges = array();
private $edges = array(); // MiTo Team: explicit class member declared

/**
* Create a new contour level "algorithm machine".
Expand Down Expand Up @@ -389,7 +389,8 @@ function getIsobars() {
class ContourPlot extends Plot {

private $contour, $contourCoord, $contourVal, $contourColor;
private $nbrContours = 0 ; /* mitoteam: was $nbrCountours in original sources */
private $nbrContours = 0 ; // MiTo Team: was $nbrCountours in original sources

private $dataMatrix = array();
private $invertLegend = false;
private $interpFactor = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/jpgraph_pie3d.php
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ function Pie3D($aaoption,$img,$data,$colors,$xc,$yc,$d,$angle,$z,
// Now print possible labels and add csim
$this->value->ApplyFont($img);
$margin = $img->GetFontHeight()/2 + $this->value->margin ;
$labelpoasadj = $this->ilabelposadj === 'auto' ? 1.0 : $this->ilabelposadj; //mitoteam: 'auto' can not be used as float
$labelpoasadj = $this->ilabelposadj === 'auto' ? 1.0 : $this->ilabelposadj; // MiTo Team: 'auto' can not be used as float
for($i=0; $i < count($data); ++$i ) {
$la = $labeldata[$i][0];
$x = $labeldata[$i][1] + cos($la*M_PI/180)*($d+$margin)*$labelpoasadj;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/jpgraph_plotmark.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ function AddCSIMPoly($aPts) {
}

function AddCSIMCircle($x,$y,$r) {
$x = round((float)$x); $y=round((float)$y); $r=round((float)$r); //mitoteam: typecast added
$x = round((float)$x); $y=round((float)$y); $r=round((float)$r); // MiTo Team: explicit type casting
$this->csimareas="";
if( !empty($this->csimtarget) ) {
$this->csimareas .= "<area shape=\"circle\" coords=\"$x,$y,$r\" href=\"".htmlentities($this->csimtarget)."\"";
Expand Down Expand Up @@ -318,8 +318,8 @@ function Stroke($img,$x,$y) {
}

$weight = $this->weight;
$dx=round((float)$width/2,0); //mitoteam: typecast added
$dy=round((float)$width/2,0); //mitoteam: typecast added
$dx=round((float)$width/2,0); // MiTo Team: explicit type casting
$dy=round((float)$width/2,0); // MiTo Team: explicit type casting
$pts=0;

switch( $this->type ) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/jpgraph_regstat.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function Interpolate($xpoint) {

// Binary search to find interval
while( $max-$min > 1 ) {
$k = (int) floor(($max+$min) / 2);
$k = (int) floor(($max+$min) / 2); // MiTo Team: explicit type casting
if( $this->xdata[$k] > $xpoint )
$max=$k;
else
Expand Down
2 changes: 1 addition & 1 deletion src/lib/jpgraph_theme.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//===================================================
abstract class Theme {
protected $color_index;
protected $graph; /* mitoteam: absent in original sources */
protected $graph; // MiTo Team: explicit class member declared

function __construct() {
$this->color_index = 0;
Expand Down

0 comments on commit 891f7c7

Please sign in to comment.