~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to src/2geom/bezier-utils.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Ted Gould, Kees Cook
  • Date: 2009-06-24 14:00:43 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624140043-07stp20mry48hqup
Tags: 0.47~pre0-0ubuntu1
* New upstream release

[ Ted Gould ]
* debian/control: Adding libgsl0 and removing version specifics on boost

[ Kees Cook ]
* debian/watch: updated to run uupdate and mangle pre-release versions.
* Dropped patches that have been taken upstream:
  - 01_mips
  - 02-poppler-0.8.3
  - 03-chinese-inkscape
  - 05_fix_latex_patch
  - 06_gcc-4.4
  - 07_cdr2svg
  - 08_skip-bad-utf-on-pdf-import
  - 09_gtk-clist
  - 10_belarussian
  - 11_libpng
  - 12_desktop
  - 13_slider
  - 100_svg_import_improvements
  - 102_sp_pattern_painter_free
  - 103_bitmap_type_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
#define noBEZIER_DEBUG
49
49
 
50
50
#ifdef HAVE_IEEEFP_H
51
 
# include <ieefp.h>
 
51
# include <ieeefp.h>
52
52
#endif
53
53
 
54
 
#include "bezier-utils.h"
 
54
#include <2geom/bezier-utils.h>
55
55
 
56
 
#include "isnan.h"
 
56
#include <2geom/isnan.h>
57
57
#include <assert.h>
58
58
 
59
59
namespace Geom{
165
165
        if ( si == src_len ) {
166
166
            return 0;
167
167
        }
168
 
        if (!is_nan(src[si][X]) &&
169
 
            !is_nan(src[si][Y])) {
 
168
        if (!IS_NAN(src[si][X]) &&
 
169
            !IS_NAN(src[si][Y])) {
170
170
            dest[0] = Point(src[si]);
171
171
            ++si;
172
172
            break;
173
173
        }
 
174
        si++;
174
175
    }
175
176
    unsigned di = 0;
176
177
    for (; si < src_len; ++si) {
177
178
        Point const src_pt = Point(src[si]);
178
179
        if ( src_pt != dest[di]
179
 
             && !is_nan(src_pt[X])
180
 
             && !is_nan(src_pt[Y])) {
 
180
             && !IS_NAN(src_pt[X])
 
181
             && !IS_NAN(src_pt[Y])) {
181
182
            dest[++di] = src_pt;
182
183
        }
183
184
    }
216
217
        bezier[0] = data[0];
217
218
        bezier[3] = data[len - 1];
218
219
        double const dist = distance(bezier[0], bezier[3]) / 3.0;
219
 
        if (is_nan(dist)) {
 
220
        if (IS_NAN(dist)) {
220
221
            /* Numerical problem, fall back to straight line segment. */
221
222
            bezier[1] = bezier[0];
222
223
            bezier[2] = bezier[3];
619
620
        }
620
621
    }
621
622
 
622
 
    if (!is_finite(improved_u)) {
 
623
    if (!IS_FINITE(improved_u)) {
623
624
        improved_u = u;
624
625
    } else if ( improved_u < 0.0 ) {
625
626
        improved_u = 0.0;
853
854
    double tot_len = u[len - 1];
854
855
    if(!( tot_len != 0 ))
855
856
        return;
856
 
    if (is_finite(tot_len)) {
 
857
    if (IS_FINITE(tot_len)) {
857
858
        for (unsigned i = 1; i < len; ++i) {
858
859
            u[i] /= tot_len;
859
860
        }