CairoContext::hasCurrentPoint

(PECL cairo >= 0.1.0)
The hasCurrentPoint purpose
public bool CairoContext::hasCurrentPoint ( void )

Object oriented style (method):

Procedural style:

bool cairo_has_current_point ( CairoContext $context )

Returns whether a current point is defined on the current path. See CairoContext::getCurrentPoint() for details on the current point.

Parameters:
context

A valid CairoContext object.

Returns:

Whether a current point is defined

Examples:
Object oriented style
1
2
3
4
5
6
7
8
9
10
11
12
<?php
 
$s new CairoImageSurface(CairoFormat::ARGB32, 100, 100);
$c new CairoContext($s);
 
var_dump($c->hasCurrentPoint());
 
$c->moveTo(10, 10);
 
var_dump($c->hasCurrentPoint());
 
?>

The above example will output:

bool(false)
bool(true)
Procedural style
1
2
3
4
5
6
7
8
9
10
11
12
<?php
 
$s = cairo_image_surface_create(CAIRO_SURFACE_TYPE_IMAGE, 100, 100);
$c = cairo_create($s);
 
var_dump(cairo_has_current_point($c));
 
cairo_move_to($c, 10, 10);
 
var_dump(cairo_has_current_point($c));
 
?>

The above example will output:

bool(false)
bool(true)
See also:

CairoContext::getCurrentPoint() -

doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.