mirror of https://github.com/FreeRDP/FreeRDP
Merge branch 'master' of github.com:FreeRDP/FreeRDP
This commit is contained in:
commit
be6d043dd6
|
@ -573,6 +573,9 @@ void xf_gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
int x1, y1;
|
||||||
|
int x2, y2;
|
||||||
|
int npoints;
|
||||||
uint32 color;
|
uint32 color;
|
||||||
XPoint* points;
|
XPoint* points;
|
||||||
int width, height;
|
int width, height;
|
||||||
|
@ -584,49 +587,43 @@ void xf_gdi_polyline(rdpUpdate* update, POLYLINE_ORDER* polyline)
|
||||||
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
|
XSetFillStyle(xfi->display, xfi->gc, FillSolid);
|
||||||
XSetForeground(xfi->display, xfi->gc, color);
|
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++)
|
for (i = 0; i < polyline->numPoints; i++)
|
||||||
{
|
{
|
||||||
points[i].x = polyline->points[i].x;
|
points[i + 1].x = polyline->points[i].x;
|
||||||
points[i].y = polyline->points[i].y;
|
points[i + 1].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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (height < 0)
|
XDrawLines(xfi->display, xfi->drawing, xfi->gc, points, npoints, CoordModePrevious);
|
||||||
{
|
|
||||||
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);
|
|
||||||
|
|
||||||
if (xfi->drawing == xfi->primary)
|
if (xfi->drawing == xfi->primary)
|
||||||
{
|
{
|
||||||
if (xfi->remote_app != True)
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -417,9 +417,6 @@ INLINE void update_read_delta_points(STREAM* s, DELTA_POINT* points, int number,
|
||||||
if (~flags & 0x40)
|
if (~flags & 0x40)
|
||||||
update_read_delta(s, &points[i].y);
|
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;
|
flags <<= 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue