forked from halo-battle/game
Ajout d'une étape de linting dans DroneCi (#3)
Corrige un doublons laissé par le rebase semi-manuel Ajout d'une étape de linting dans DroneCi Fix linting Co-authored-by: Nigel Sheldon <nigelsheldon@live.fr> Reviewed-on: https://gitea.nemunai.re/halo-battle/game/pulls/3
This commit is contained in:
parent
5b17a7dbd7
commit
dd61d3b66b
263 changed files with 45327 additions and 42695 deletions
|
|
@ -15,81 +15,88 @@
|
|||
// might be used together with the basic Image drawing
|
||||
// primitives. Useful to auickoly produce some arbitrary
|
||||
// graphic which benefits from all the functionality in the
|
||||
// graph liek caching for example.
|
||||
// graph liek caching for example.
|
||||
//===================================================
|
||||
class CanvasGraph extends Graph {
|
||||
//---------------
|
||||
// CONSTRUCTOR
|
||||
function CanvasGraph($aWidth=300,$aHeight=200,$aCachedName="",$timeout=0,$inline=1) {
|
||||
$this->Graph($aWidth,$aHeight,$aCachedName,$timeout,$inline);
|
||||
class CanvasGraph extends Graph
|
||||
{
|
||||
//---------------
|
||||
// CONSTRUCTOR
|
||||
public function CanvasGraph($aWidth=300, $aHeight=200, $aCachedName="", $timeout=0, $inline=1)
|
||||
{
|
||||
$this->Graph($aWidth, $aHeight, $aCachedName, $timeout, $inline);
|
||||
}
|
||||
|
||||
//---------------
|
||||
// PUBLIC METHODS
|
||||
//---------------
|
||||
// PUBLIC METHODS
|
||||
|
||||
function InitFrame() {
|
||||
$this->StrokePlotArea();
|
||||
public function InitFrame()
|
||||
{
|
||||
$this->StrokePlotArea();
|
||||
}
|
||||
|
||||
// Method description
|
||||
function Stroke($aStrokeFileName="") {
|
||||
if( $this->texts != null ) {
|
||||
for($i=0; $i < count($this->texts); ++$i) {
|
||||
$this->texts[$i]->Stroke($this->img);
|
||||
}
|
||||
}
|
||||
if( $this->iTables !== null ) {
|
||||
for($i=0; $i < count($this->iTables); ++$i) {
|
||||
$this->iTables[$i]->Stroke($this->img);
|
||||
}
|
||||
}
|
||||
$this->StrokeTitles();
|
||||
public function Stroke($aStrokeFileName="")
|
||||
{
|
||||
if ($this->texts != null) {
|
||||
for ($i=0; $i < count($this->texts); ++$i) {
|
||||
$this->texts[$i]->Stroke($this->img);
|
||||
}
|
||||
}
|
||||
if ($this->iTables !== null) {
|
||||
for ($i=0; $i < count($this->iTables); ++$i) {
|
||||
$this->iTables[$i]->Stroke($this->img);
|
||||
}
|
||||
}
|
||||
$this->StrokeTitles();
|
||||
|
||||
// If the filename is the predefined value = '_csim_special_'
|
||||
// we assume that the call to stroke only needs to do enough
|
||||
// to correctly generate the CSIM maps.
|
||||
// We use this variable to skip things we don't strictly need
|
||||
// to do to generate the image map to improve performance
|
||||
// a best we can. Therefor you will see a lot of tests !$_csim in the
|
||||
// code below.
|
||||
$_csim = ($aStrokeFileName===_CSIM_SPECIALFILE);
|
||||
// If the filename is the predefined value = '_csim_special_'
|
||||
// we assume that the call to stroke only needs to do enough
|
||||
// to correctly generate the CSIM maps.
|
||||
// We use this variable to skip things we don't strictly need
|
||||
// to do to generate the image map to improve performance
|
||||
// a best we can. Therefor you will see a lot of tests !$_csim in the
|
||||
// code below.
|
||||
$_csim = ($aStrokeFileName===_CSIM_SPECIALFILE);
|
||||
|
||||
// We need to know if we have stroked the plot in the
|
||||
// GetCSIMareas. Otherwise the CSIM hasn't been generated
|
||||
// and in the case of GetCSIM called before stroke to generate
|
||||
// CSIM without storing an image to disk GetCSIM must call Stroke.
|
||||
$this->iHasStroked = true;
|
||||
// We need to know if we have stroked the plot in the
|
||||
// GetCSIMareas. Otherwise the CSIM hasn't been generated
|
||||
// and in the case of GetCSIM called before stroke to generate
|
||||
// CSIM without storing an image to disk GetCSIM must call Stroke.
|
||||
$this->iHasStroked = true;
|
||||
|
||||
if( !$_csim ) {
|
||||
if (!$_csim) {
|
||||
|
||||
// Should we do any final image transformation
|
||||
if( $this->iImgTrans ) {
|
||||
if( !class_exists('ImgTrans') ) {
|
||||
require_once('jpgraph_imgtrans.php');
|
||||
}
|
||||
|
||||
$tform = new ImgTrans($this->img->img);
|
||||
$this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist,
|
||||
$this->iImgTransDirection,$this->iImgTransHighQ,
|
||||
$this->iImgTransMinSize,$this->iImgTransFillColor,
|
||||
$this->iImgTransBorder);
|
||||
}
|
||||
|
||||
// Should we do any final image transformation
|
||||
if ($this->iImgTrans) {
|
||||
if (!class_exists('ImgTrans')) {
|
||||
require_once('jpgraph_imgtrans.php');
|
||||
}
|
||||
|
||||
$tform = new ImgTrans($this->img->img);
|
||||
$this->img->img = $tform->Skew3D(
|
||||
$this->iImgTransHorizon,
|
||||
$this->iImgTransSkewDist,
|
||||
$this->iImgTransDirection,
|
||||
$this->iImgTransHighQ,
|
||||
$this->iImgTransMinSize,
|
||||
$this->iImgTransFillColor,
|
||||
$this->iImgTransBorder
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// If the filename is given as the special _IMG_HANDLER
|
||||
// then the image handler is returned and the image is NOT
|
||||
// streamed back
|
||||
if( $aStrokeFileName == _IMG_HANDLER ) {
|
||||
return $this->img->img;
|
||||
}
|
||||
else {
|
||||
// Finally stream the generated picture
|
||||
$this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// If the filename is given as the special _IMG_HANDLER
|
||||
// then the image handler is returned and the image is NOT
|
||||
// streamed back
|
||||
if ($aStrokeFileName == _IMG_HANDLER) {
|
||||
return $this->img->img;
|
||||
} else {
|
||||
// Finally stream the generated picture
|
||||
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Class
|
||||
|
||||
/* EOF */
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue