~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to display/drivers/XDRIVER/Polygon.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "includes.h"
2
 
#include "XDRIVER.h"
3
 
 
4
 
/* A polygon is drawn using the current color.  It has "number"
5
 
 * verticies which are found in the absolute coordinate pairs
6
 
 * represented in the "xarray" and "yarray" arrays.  NOTE: Cursor
7
 
 * location is NOT updated in Polygon_rel(). */
8
 
 
9
 
void XD_Polygon_abs(const int *xarray, const int *yarray, int number)
10
 
{
11
 
    XPoint *xpnts = alloc_xpoints(number);
12
 
    int i;
13
 
 
14
 
    if (number < 1)
15
 
        return;
16
 
 
17
 
    for (i = 0; i < number; i++) {
18
 
        xpnts[i].x = (short)xarray[i];
19
 
        xpnts[i].y = (short)yarray[i];
20
 
    }
21
 
 
22
 
    XFillPolygon(dpy, bkupmap, gc, xpnts, number, Complex, CoordModeOrigin);
23
 
    needs_flush = 1;
24
 
}
25
 
 
26
 
void XD_Polygon_rel(const int *xarray, const int *yarray, int number)
27
 
{
28
 
    XPoint *xpnts = alloc_xpoints(number);
29
 
    int i;
30
 
 
31
 
    if (number < 1)
32
 
        return;
33
 
 
34
 
    xpnts[0].x = (short)(xarray[0] + cur_x);
35
 
    xpnts[0].y = (short)(yarray[0] + cur_y);
36
 
 
37
 
    for (i = 1; i < number; i++) {
38
 
        xpnts[i].x = (short)xarray[i];
39
 
        xpnts[i].y = (short)yarray[i];
40
 
    }
41
 
 
42
 
    XFillPolygon(dpy, bkupmap, gc, xpnts, number, Complex, CoordModePrevious);
43
 
    needs_flush = 1;
44
 
}