void wf_gdi_polyline(wfContext* wfc, POLYLINE_ORDER* polyline)
{
- int i;
- POINT* pts;
int org_rop2;
HPEN hpen;
HPEN org_hpen;
org_rop2 = wf_set_rop2(wfc->drawing->hdc, polyline->bRop2);
org_hpen = (HPEN) SelectObject(wfc->drawing->hdc, hpen);
- if (polyline->numPoints > 0)
+ if (polyline->numDeltaEntries > 0)
{
- POINT temp;
+ POINT *pts;
+ POINT temp;
+ int numPoints;
+ int i;
- temp.x = polyline->xStart;
- temp.y = polyline->yStart;
- pts = (POINT*) malloc(sizeof(POINT) * polyline->numPoints);
+ numPoints = polyline->numDeltaEntries + 1;
+ pts = (POINT*) malloc(sizeof(POINT) * numPoints);
+ pts[0].x = temp.x = polyline->xStart;
+ pts[0].y = temp.y = polyline->yStart;
- for (i = 0; i < (int) polyline->numPoints; i++)
+ for (i = 0; i < (int) polyline->numDeltaEntries; i++)
{
temp.x += polyline->points[i].x;
temp.y += polyline->points[i].y;
- pts[i].x = temp.x;
- pts[i].y = temp.y;
-
- if (wfc->drawing == wfc->primary)
- wf_invalidate_region(wfc, pts[i].x, pts[i].y, pts[i].x + 1, pts[i].y + 1);
+ pts[i + 1].x = temp.x;
+ pts[i + 1].y = temp.y;
}
-
- Polyline(wfc->drawing->hdc, pts, polyline->numPoints);
+ if (wfc->drawing == wfc->primary)
+ wf_invalidate_region(wfc, wfc->client_x, wfc->client_y, wfc->client_width, wfc->client_height);
+ Polyline(wfc->drawing->hdc, pts, numPoints);
free(pts);
}
int npoints;
UINT32 color;
XPoint* points;
+ XPoint tmp;
int width, height;
xfContext* xfc = (xfContext*) context;
XSetFillStyle(xfc->display, xfc->gc, FillSolid);
XSetForeground(xfc->display, xfc->gc, color);
- npoints = polyline->numPoints + 1;
+ npoints = polyline->numDeltaEntries + 1;
points = malloc(sizeof(XPoint) * npoints);
- points[0].x = polyline->xStart;
- points[0].y = polyline->yStart;
+ points[0].x = tmp.x = polyline->xStart;
+ points[0].y = tmp.y = polyline->yStart;
- for (i = 0; i < polyline->numPoints; i++)
+ for (i = 0; i < polyline->numDeltaEntries; i++)
{
- points[i + 1].x = polyline->points[i].x;
- points[i + 1].y = polyline->points[i].y;
+ tmp.x += polyline->points[i].x;
+ tmp.y += polyline->points[i].y;
+ points[i + 1].x = tmp.x;
+ points[i + 1].y = tmp.y;
}
XDrawLines(xfc->display, xfc->drawing, xfc->gc, points, npoints, CoordModePrevious);
INT32 yStart;
UINT32 bRop2;
UINT32 penColor;
- UINT32 numPoints;
+ UINT32 numDeltaEntries;
UINT32 cbData;
DELTA_POINT* points;
};
wParam = (POLYLINE_ORDER*) malloc(sizeof(POLYLINE_ORDER));
CopyMemory(wParam, polyline, sizeof(POLYLINE_ORDER));
- wParam->points = (DELTA_POINT*) malloc(sizeof(DELTA_POINT) * wParam->numPoints);
- CopyMemory(wParam->points, polyline->points, sizeof(DELTA_POINT) * wParam->numPoints);
+ wParam->points = (DELTA_POINT*) malloc(sizeof(DELTA_POINT) * wParam->numDeltaEntries);
+ CopyMemory(wParam->points, polyline->points, sizeof(DELTA_POINT) * wParam->numDeltaEntries);
MessageQueue_Post(context->update->queue, (void*) context,
MakeMessageId(PrimaryUpdate, Polyline), (void*) wParam, NULL);
ORDER_FIELD_BYTE(3, polyline->bRop2);
ORDER_FIELD_UINT16(4, word);
ORDER_FIELD_COLOR(5, polyline->penColor);
- ORDER_FIELD_BYTE(6, polyline->numPoints);
+ ORDER_FIELD_BYTE(6, polyline->numDeltaEntries);
if (orderInfo->fieldFlags & ORDER_FIELD_07)
{
Stream_Read_UINT8(s, polyline->cbData);
if (polyline->points == NULL)
- polyline->points = (DELTA_POINT*) malloc(sizeof(DELTA_POINT) * polyline->numPoints);
+ polyline->points = (DELTA_POINT*) malloc(sizeof(DELTA_POINT) * polyline->numDeltaEntries);
else
- polyline->points = (DELTA_POINT*) realloc(polyline->points, sizeof(DELTA_POINT) * polyline->numPoints);
+ polyline->points = (DELTA_POINT*) realloc(polyline->points, sizeof(DELTA_POINT) * polyline->numDeltaEntries);
- return update_read_delta_points(s, polyline->points, polyline->numPoints, polyline->xStart, polyline->yStart);
+ return update_read_delta_points(s, polyline->points, polyline->numDeltaEntries, polyline->xStart, polyline->yStart);
}
return TRUE;
gdi_MoveToEx(gdi->drawing->hdc, x, y, NULL);
points = polyline->points;
- for (i = 0; i < (int) polyline->numPoints; i++)
+ for (i = 0; i < (int) polyline->numDeltaEntries; i++)
{
x += points[i].x;
y += points[i].y;