2009-09-30 15:20:52 +00:00
<?xml version="1.0" encoding="utf-8"?>
2009-11-18 08:10:04 +00:00
<!-- $Revision$ -->
2009-09-30 15:20:52 +00:00
<refentry xml:id= "cairocontext.getcurrentpoint" xmlns= "http://docbook.org/ns/docbook" xmlns:xlink= "http://www.w3.org/1999/xlink" >
<refnamediv >
<refname > CairoContext::getCurrentPoint</refname>
<refname > cairo_get_current_point</refname>
<refpurpose > The getCurrentPoint purpose</refpurpose>
</refnamediv>
2010-05-07 17:37:53 +00:00
2009-09-30 15:20:52 +00:00
<refsect1 role= "description" >
&reftitle.description;
2010-09-24 17:57:19 +00:00
<para > &style.oop; </para>
<methodsynopsis role= "oop" >
2009-11-23 12:02:15 +00:00
<modifier > public</modifier> <type > array</type> <methodname > CairoContext::getCurrentPoint</methodname>
2009-09-30 15:20:52 +00:00
<void />
2010-05-07 17:37:53 +00:00
</methodsynopsis>
2010-09-24 17:57:19 +00:00
<para > &style.procedural; </para>
<methodsynopsis role= "procedural" >
2009-11-23 12:02:15 +00:00
<type > array</type> <methodname > cairo_get_current_point</methodname>
2009-09-30 15:20:52 +00:00
<methodparam > <type > CairoContext</type> <parameter > context</parameter> </methodparam>
</methodsynopsis>
<para >
2010-05-07 17:37:53 +00:00
Gets the current point of the current path, which is conceptually the final point reached by the path so far.
</para>
<para >
The current point is returned in the user-space coordinate system. If there is no defined current point or if cr is in an error status, x and y will both be set to 0.0. It is possible to check this in advance with <methodname > CairoContext::hasCurrentPoint</methodname> .
</para>
<para >
Most path construction functions alter the current point. See the following for details on how they affect the current point: <methodname > CairoContext::newPath</methodname> ,
<methodname > CairoContext::newSubPath</methodname> , <methodname > CairoContext::appendPath</methodname> , <methodname > CairoContext::closePath</methodname> , <methodname > CairoContext::moveTo</methodname> ,
<methodname > CairoContext::lineTo</methodname> , <methodname > CairoContext::curveTo</methodname> , <methodname > CairoContext::relMoveTo</methodname> ,
<methodname > CairoContext::relLineTo</methodname> , <methodname > CairoContext::relCurveTo</methodname> ,
<methodname > CairoContext::arc</methodname> , <methodname > CairoContext::arcNegative</methodname> , <methodname > CairoContext::rectangle</methodname> ,
<methodname > CairoContext::textPath</methodname> , <methodname > CairoContext::glyphPath</methodname> .
</para>
<para >
Some functions use and alter the current point but do not otherwise change current path: <methodname > CairoContext::showText</methodname> .
</para>
<para >
Some functions unset the current path and as a result, current point: <methodname > CairoContext::fill</methodname> , <methodname > CairoContext::stroke</methodname> .
2009-09-30 15:20:52 +00:00
</para>
</refsect1>
2010-05-07 17:37:53 +00:00
2009-09-30 15:20:52 +00:00
<refsect1 role= "parameters" >
&reftitle.parameters;
<para >
<variablelist >
<varlistentry >
<term > <parameter > context</parameter> </term>
<listitem >
<para >
2010-05-07 17:37:53 +00:00
A valid <classname > CairoContext</classname> object.
2009-09-30 15:20:52 +00:00
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
2010-05-07 17:37:53 +00:00
2009-09-30 15:20:52 +00:00
<refsect1 role= "returnvalues" >
&reftitle.returnvalues;
<para >
2010-05-07 17:37:53 +00:00
An array containing the x (index 0) and y (index 1) coordinates of the current point.
2009-09-30 15:20:52 +00:00
</para>
</refsect1>
2010-05-07 17:37:53 +00:00
2009-09-30 15:20:52 +00:00
<refsect1 role= "examples" >
&reftitle.examples;
<para >
<example >
2012-01-11 06:50:17 +00:00
<title > &style.oop; </title>
2009-09-30 15:20:52 +00:00
<programlisting role= "php" >
< ![CDATA[
< ?php
2010-05-07 17:37:53 +00:00
$s = new CairoImageSurface(CairoFormat::ARGB32, 100, 100);
$c = new CairoContext($s);
$c->moveTo(10, 10);
var_dump($c->getCurrentPoint());
2009-09-30 15:20:52 +00:00
?>
]]>
2010-05-07 17:37:53 +00:00
</programlisting>
&example.outputs.similar;
<screen >
2009-09-30 15:20:52 +00:00
< ![CDATA[
2010-05-07 17:37:53 +00:00
array(2) {
[0]=>
float(10)
[1]=>
float(10)
}
2009-09-30 15:20:52 +00:00
]]>
</screen>
</example>
</para>
<para >
<example >
2012-01-11 06:50:17 +00:00
<title > &style.procedural; </title>
2009-09-30 15:20:52 +00:00
<programlisting role= "php" >
< ![CDATA[
< ?php
2010-05-07 17:37:53 +00:00
$s = cairo_image_surface_create(CAIRO_SURFACE_TYPE_IMAGE, 100, 100);
$c = cairo_create($s);
cairo_move_to($c, 10, 10);
var_dump(cairo_get_current_point($c));
2009-09-30 15:20:52 +00:00
?>
]]>
2010-05-07 17:37:53 +00:00
</programlisting>
&example.outputs.similar;
<screen >
2009-09-30 15:20:52 +00:00
< ![CDATA[
2010-05-07 17:37:53 +00:00
array(2) {
[0]=>
float(10)
[1]=>
float(10)
}
2009-09-30 15:20:52 +00:00
]]>
</screen>
</example>
</para>
</refsect1>
2010-05-07 17:37:53 +00:00
2009-09-30 15:20:52 +00:00
<refsect1 role= "seealso" >
&reftitle.seealso;
<para >
<simplelist >
2010-05-07 17:37:53 +00:00
<member > <methodname > CairoContext::moveTo</methodname> </member>
<member > <methodname > CairoContext::hasCurrentPoint</methodname> </member>
2009-09-30 15:20:52 +00:00
</simplelist>
</para>
</refsect1>
2010-05-07 17:37:53 +00:00
2009-09-30 15:20:52 +00:00
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
2010-02-03 13:03:22 +00:00
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
2009-09-30 15:20:52 +00:00
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->