~ubuntu-branches/ubuntu/maverick/cairo/maverick

« back to all changes in this revision

Viewing changes to src/cairo-slope.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2010-06-26 16:13:32 UTC
  • mfrom: (1.3.3 upstream) (1.5.10 experimental)
  • Revision ID: james.westby@ubuntu.com-20100626161332-s14u9kutazlea7c1
Tags: 1.9.10-1
* New upstream development release:
  + Use subpixel rendering settings for fonts (Closes: #555722).
  + debian/patches/99_autoreconf.patch:
    - Regenerated for the new version.
  + debian/patches/01_no-private-symbol-export.patch,
    debian/patches/03_no-cxx.patch,
    debian/patches/05_am-maintainer-mode.patch,
    debian/patches/99_ltmain_as-needed.patch:
    - Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 *
13
13
 * You should have received a copy of the LGPL along with this library
14
14
 * in the file COPYING-LGPL-2.1; if not, write to the Free Software
15
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
15
 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA
16
16
 * You should have received a copy of the MPL along with this library
17
17
 * in the file COPYING-MPL-1.1
18
18
 *
36
36
 
37
37
#include "cairoint.h"
38
38
 
39
 
void
40
 
_cairo_slope_init (cairo_slope_t *slope,
41
 
                   const cairo_point_t *a,
42
 
                   const cairo_point_t *b)
43
 
{
44
 
    slope->dx = b->x - a->x;
45
 
    slope->dy = b->y - a->y;
46
 
}
 
39
#include "cairo-slope-private.h"
47
40
 
48
41
/* Compare two slopes. Slope angles begin at 0 in the direction of the
49
42
   positive X axis and increase in the direction of the positive Y
94
87
     * of b by an infinitesimally small amount, (that is, 'a' will
95
88
     * always be considered less than 'b').
96
89
     */
97
 
    if (((a->dx > 0) != (b->dx > 0)) ||
98
 
        ((a->dy > 0) != (b->dy > 0)))
99
 
    {
 
90
    if ((a->dx ^ b->dx) < 0 || (a->dy ^ b->dy) < 0) {
100
91
        if (a->dx > 0 || (a->dx == 0 && a->dy > 0))
101
92
            return +1;
102
93
        else