Merge branch 'master' of github.com:FreeRDP/FreeRDP

This commit is contained in:
Marc-André Moreau 2011-10-13 15:51:20 -04:00
commit be6d043dd6
2 changed files with 30 additions and 36 deletions

View File

@ -573,6 +573,9 @@ void xf_gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
{
int i;
int x, y;
int x1, y1;
int x2, y2;
int npoints;
uint32 color;
XPoint* points;
int width, height;
@ -584,49 +587,43 @@ void xf_gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
XSetForeground(xfi->display, xfi->gc, color);
points = xmalloc(sizeof(XPoint) * polyline->numPoints);
npoints = polyline->numPoints + 1;
points = xmalloc(sizeof(XPoint) * npoints);
points[0].x = polyline->xStart;
points[0].y = polyline->yStart;
for (i = 0; i < polyline->numPoints; i++)
{
points[i].x = polyline->points[i].x;
points[i].y = polyline->points[i].y;
if (i > 0)
{
width = points[i].x - points[i - 1].x;
height = points[i].y - points[i - 1].y;
if (width < 0)
{
width *= (-1);
x = points[i].x;
}
else
{
x = points[i - 1].x;
points[i + 1].x = polyline->points[i].x;
points[i + 1].y = polyline->points[i].y;
}
if (height < 0)
{
height *= (-1);
y = points[i].y;
}
else
{
y = points[i - 1].y;
}
gdi_InvalidateRegion(xfi->hdc, x, y, width, height);
}
}
XDrawLines(xfi->display, xfi->drawing, xfi->gc, points, polyline->numPoints, CoordModePrevious);
XDrawLines(xfi->display, xfi->drawing, xfi->gc, points, npoints, CoordModePrevious);
if (xfi->drawing == xfi->primary)
{
if (xfi->remote_app != True)
XDrawLines(xfi->display, xfi->drawable, xfi->gc, points, npoints, CoordModePrevious);
x1 = points[0].x;
y1 = points[0].y;
for (i = 1; i < npoints; i++)
{
XDrawLines(xfi->display, xfi->drawable, xfi->gc, points, polyline->numPoints, CoordModePrevious);
x2 = points[i].x + x1;
y2 = points[i].y + y1;
x = (x2 < x1) ? x2 : x1;
width = (x2 > x1) ? x2 - x1 : x1 - x2;
y = (y2 < y1) ? y2 : y1;
height = (y2 > y1) ? y2 - y1 : y1 - y2;
x1 = x2;
y1 = y2;
gdi_InvalidateRegion(xfi->hdc, x, y, width, height);
}
}

View File

@ -417,9 +417,6 @@ INLINE void update_read_delta_points(STREAM* s, DELTA_POINT* points, int number,
if (~flags & 0x40)
update_read_delta(s, &points[i].y);
points[i].x += (i > 0 ? points[i - 1].x : x);
points[i].y += (i > 0 ? points[i - 1].y : y);
flags <<= 2;
}
}