Commit graph

24 commits

Author SHA1 Message Date
Heiko Lewin
ab2c5ee21e _arc_max_angle_for_tolerance_normalized: fix infinite loop 2021-08-01 11:16:03 +00:00
Chris Wilson
06a737b74d arc: Insert the initial point on the arc
Currently the very first point on the arc will be the first interpreted
location along the spline used to approximate the arc. This will be
close, but not quite the exact point the user intended the arc to run
from, so begin the arc with a line-to the initial point.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-24 12:35:47 +01:00
Chris Wilson
f7d937670c arc: Use user endpoint for final step
Eliminate numerical inaccuracy from accumulating angle through
the floating point step value by using the exact end-value for the last
arc segment.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-05-14 16:09:29 +01:00
Andrea Canciani
7f635e4ead doc: Make doc ids more consistent my always putting ':' after them
This makes the documentations comments more consistent and fixes many
reports of 'invalid doc id'.
2012-03-29 11:03:18 +02:00
Behdad Esfahbod
ede11b2954 Fix math in comments 2012-03-25 14:38:39 -04:00
Behdad Esfahbod
2721d05d69 Typo 2012-03-25 14:38:38 -04:00
Andrea Canciani
1784fd403e arc: Clamp to 65536 full circles
To limit the amount of memory used for arcs describing a circle
wrapped multiple times we ignore the circles after the 65536th (but
preserve the same start and end angle mod 2pi).
2010-12-09 17:33:12 +01:00
Andrea Canciani
0655198301 Fix degenerate arcs
Make sure that degenerate arcs become a move_to-line_to sequence
instead of just a move_to.

Fixes get-path-extents.
2010-10-29 17:31:23 +02:00
Andrea Canciani
b8a7f8621a Update FSF address
I updated the Free Software Foundation address using the following script.

for i in $(git grep Temple | cut -d: -f1 )
do
  sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
2010-04-27 11:13:38 +02:00
Chris Wilson
eba6b5126a [build] Add options for warning about bad casts
-Wbad-function-cast in particular. Triggers quite a few warnings where we
have explicitly cast to an integer.
2009-08-29 08:08:38 +01:00
Behdad Esfahbod
e8e2386233 Remove some bogus XXX marks
These are all perfectly correct code.  Most are simply there because when
we support vertical text writing mode we need to update there, but that's
pretty trivial.  No special markers needed.

/me is trying to make user-font clean of XXX and TODO marks
2008-05-28 19:10:09 -04:00
Chris Wilson
4b3f9c7c7d [cairo-arc] Protect against division-by-zero.
Avoid a division-by-zero which can only happen if the start angle is
exactly equal to the end angle.

Fixes test/degenerate-arc.
2008-05-06 14:31:13 +01:00
Chris Wilson
b72fe9bb5f [cairo-arc] Check that the context is not error before proceeding.
We depend on values stored on the context that become invalid upon an
error, so stop processing as soon as an error occurs. Prior to
adjusting, the values returned from the error context, this would cause
an infinite loop whilst calculating the number of segments required for
a tolerance of 0.
2008-04-11 15:39:10 +01:00
Carl Worth
01955a6e82 Rename ARRAY_LEN to ARRAY_LENGTH
Yet another victim in my hunt against abbreviations within cairo's implementation.
2007-04-10 10:14:49 -07:00
Behdad Esfahbod
8fbf50d31d [src] Make sure all source files #include "cairoint.h" as their first include
This is necessary to avoid many portability problems as cairoint.h includes
config.h.  Without a test, we will regress again, hence add it.

The inclusion idiom for cairo now is:

	#include "cairoint.h"

	#include "cairo-something.h"
	#include "cairo-anotherthing-private.h"

	#include <some-library.h>
	#include <other-library/other-file.h>

Moreover, some standard headers files are included from cairoint.h and need
not be included again.
2007-04-03 20:28:11 -04:00
Behdad Esfahbod
ad51ee5aa0 Define and use ARRAY_LEN 2007-03-20 18:59:19 -04:00
Declan Naughton
7724c575b0 Fix typos in internal documentation. 2006-08-07 10:33:15 -07:00
Carl Worth
4670366ede Remove trailing whitespace from lines that look like comments.
This patch was produced with the following (GNU) sed script:

	sed -i -r -e '/^[ \t]*\/?\*/ s/[ \t]+$//'

run on all *.[ch] files within cairo, (though I manually excluded
src/cairo-atsui-font.c which has a code line that appears as a comment
to this script).
2006-06-06 15:35:48 -07:00
Carl Worth
80b8deb1e4 Remove extraneous whitespace from "blank" lines.
This patch was produced with the following (GNU) sed script:

	sed -i -r -e 's/^[ \t]+$//'

run on all *.[ch] files within cairo.
2006-06-06 15:25:49 -07:00
Bertram Felgenhauer
9883104290 correct the calculation of the error bound. 2005-08-22 16:50:30 +00:00
Carl Worth
a2dc18fd0c Remove include of math.h since cairoint.h does it more carefully, (for annoying platforms for which just including math.h without extra defines is not enough).
Replace Cairo with cairo.
Include config.h so HAVE_UNISTD_H gets picked up as necessary.
Fix non-UTF-8 copyright symbol.
2005-08-05 10:05:29 +00:00
Carl Worth
48e5806f1e Note that the cairo_content_t work is done.
Note that this function is computing an incorrect result.
2005-07-11 13:29:45 +00:00
Carl Worth
4e1cce108b Don't use return when calling a void function (thanks to Damien Carbery <damien.carbery@sun.com>). Closes bug #3134. 2005-05-10 20:38:21 +00:00
Carl Worth
1baa4d1329 Originally: 2005-04-19 Carl Worth <cworth@cworth.org>
Add cairo_stroke_preserve, cairo_fill_preserve, and cairo_clip_preserve.
Rip the path out of cairo_gstate_t.
Add path to cairo_t.
Bring in most of the path code that used to live in cairo-gstate.c
Move arc generation code into its own file.
Accept path+ctm_inverse+tolerance instead of gstate. Absorb flattening and device space->user space conversion that used to be in _cairo_gstate_intepret_path.
Prefer cairo_fixed_t parameters over ciaro_point_t for cross-file interfaces.
Track changes in _cairo_path_fixed interfaces.
Port to use cairo_fill_preserve rather than cairo_save/cairo_restore which no longer work for saving the path.
Remove get and set of current point since it is no longer affected by cairo_save and cairo_restore. Add get and set testing for cairo_matrix_t.
2005-04-26 12:38:06 +00:00