diff -urNwb -x CVS -x WIN32_20.1_i386_DBG -x WIN32_20.1_i386_OBJ -x abidiff.cmd -x patch.txt -x .#*.* abi.org\src\/af/gr/win/gr_Win32Graphics.cpp abi.pow\src\/af/gr/win/gr_Win32Graphics.cpp --- abi.org\src\/af/gr/win/gr_Win32Graphics.cpp Thu May 11 09:00:25 2000 +++ abi.pow\src\/af/gr/win/gr_Win32Graphics.cpp Mon Jun 05 17:33:46 2000 @@ -298,6 +298,34 @@ FREEP(points); } +void GR_Win32Graphics::polygon(UT_RGBColor& c,UT_Point *pts,UT_uint32 nPoints) +{ + HPEN hPen = CreatePen(PS_SOLID,1,RGB(c.m_red,c.m_grn,c.m_blu)); + HPEN hOldPen = (HPEN)SelectObject(m_hdc,hPen); + + HBRUSH hBrush = CreateSolidBrush(RGB(c.m_red,c.m_grn,c.m_blu)); + HBRUSH hOldBrush = (HBRUSH)SelectObject(m_hdc,hBrush); + + POINT * points = (POINT *)calloc(nPoints, sizeof(POINT)); + UT_ASSERT(points); + + for (UT_uint32 i = 0;i < nPoints;i++){ + points[i].x = pts[i].x; + points[i].y = pts[i].y; + } + + Polygon(m_hdc,points,nPoints); + + (void) SelectObject(m_hdc,hOldPen); + DeleteObject(hPen); + + (void) SelectObject(m_hdc,hOldBrush); + DeleteObject(hBrush); + + FREEP(points); +} + + void GR_Win32Graphics::fillRect(UT_RGBColor& c, UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h) { RECT r; diff -urNwb -x CVS -x WIN32_20.1_i386_DBG -x WIN32_20.1_i386_OBJ -x abidiff.cmd -x patch.txt -x .#*.* abi.org\src\/af/gr/win/gr_Win32Graphics.h abi.pow\src\/af/gr/win/gr_Win32Graphics.h --- abi.org\src\/af/gr/win/gr_Win32Graphics.h Thu Apr 20 09:03:05 2000 +++ abi.pow\src\/af/gr/win/gr_Win32Graphics.h Mon Jun 05 17:24:51 2000 @@ -86,6 +86,7 @@ virtual void xorLine(UT_sint32, UT_sint32, UT_sint32, UT_sint32); virtual void setLineWidth(UT_sint32); virtual void polyLine(UT_Point * pts, UT_uint32 nPoints); + virtual void polygon(UT_RGBColor& c,UT_Point *pts,UT_uint32 nPoints); virtual void fillRect(UT_RGBColor& c, UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h); diff -urNwb -x CVS -x WIN32_20.1_i386_DBG -x WIN32_20.1_i386_OBJ -x abidiff.cmd -x patch.txt -x .#*.* abi.org\src\/af/gr/xp/gr_Graphics.cpp abi.pow\src\/af/gr/xp/gr_Graphics.cpp --- abi.org\src\/af/gr/xp/gr_Graphics.cpp Thu Apr 20 09:03:05 2000 +++ abi.pow\src\/af/gr/xp/gr_Graphics.cpp Mon Jun 05 17:25:11 2000 @@ -157,4 +157,38 @@ void GR_Graphics::flush(void) { // default implementation does nothing +} + +UT_Bool GR_Graphics::_PtInPolygon(UT_Point * pts,UT_uint32 nPoints,UT_sint32 x,UT_sint32 y) +{ + UT_uint32 i,j; + UT_Bool bResult = UT_FALSE; + for (i = 0,j = nPoints - 1;i < nPoints;j = i++){ + if ((((pts[i].y <= y) && (y < pts[j].y)) || ((pts[j].y <= y) && (y < pts[i].y))) && + (x < (pts[j].x - pts[i].x) * (y - pts[i].y) / (pts[j].y - pts[i].y) + pts[i].x)) + { + bResult = !bResult; + } + } + return (bResult); +} + +void GR_Graphics::polygon(UT_RGBColor& c,UT_Point *pts,UT_uint32 nPoints) +{ + UT_sint32 minX,maxX,minY,maxY,x,y; + minX = maxX = pts[0].x; + minY = maxY = pts[0].y; + for(UT_uint32 i = 0;i < nPoints - 1;i++){ + minX = UT_MIN(minX,pts[i].x); + maxX = UT_MAX(maxX,pts[i].x); + minY = UT_MIN(minY,pts[i].y); + maxY = UT_MAX(maxY,pts[i].y); + } + for(x = minX;x <= maxX;x++){ + for(y = minY;y <= maxY;y++){ + if(_PtInPolygon(pts,nPoints,x,y)){ + fillRect(c,x,y,1,1); + } + } + } } diff -urNwb -x CVS -x WIN32_20.1_i386_DBG -x WIN32_20.1_i386_OBJ -x abidiff.cmd -x patch.txt -x .#*.* abi.org\src\/af/gr/xp/gr_Graphics.h abi.pow\src\/af/gr/xp/gr_Graphics.h --- abi.org\src\/af/gr/xp/gr_Graphics.h Thu Apr 20 09:03:07 2000 +++ abi.pow\src\/af/gr/xp/gr_Graphics.h Mon Jun 05 17:25:05 2000 @@ -105,6 +105,7 @@ virtual void xorLine(UT_sint32, UT_sint32, UT_sint32, UT_sint32) = 0; virtual void setLineWidth(UT_sint32) = 0; virtual void polyLine(UT_Point * pts, UT_uint32 nPoints) = 0; + virtual void polygon(UT_RGBColor& c,UT_Point *pts,UT_uint32 nPoints); virtual void fillRect(UT_RGBColor& c, UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h) = 0; virtual void fillRect(UT_RGBColor& c, UT_Rect &r) = 0; virtual void invertRect(const UT_Rect* pRect) = 0; @@ -192,7 +193,8 @@ UT_uint32 m_iZoomPercentage; UT_Bool m_bLayoutResolutionModeEnabled; - +private: + UT_Bool _PtInPolygon(UT_Point * pts,UT_uint32 nPoints,UT_sint32 x,UT_sint32 y); }; #endif /* GR_GRAPHICS_H */ diff -urNwb -x CVS -x WIN32_20.1_i386_DBG -x WIN32_20.1_i386_OBJ -x abidiff.cmd -x patch.txt -x .#*.* abi.org\src\/text/fmt/xp/fp_Run.cpp abi.pow\src\/text/fmt/xp/fp_Run.cpp --- abi.org\src\/text/fmt/xp/fp_Run.cpp Mon Jun 05 08:47:08 2000 +++ abi.pow\src\/text/fmt/xp/fp_Run.cpp Mon Jun 05 17:25:33 2000 @@ -459,7 +459,7 @@ return; } - #define NPOINTS 8 + #define NPOINTS 4 UT_Point * points = (UT_Point *)calloc(NPOINTS,sizeof(UT_Point)); UT_ASSERT(points); @@ -469,32 +469,21 @@ UT_uint32 iMaxWidth = iWidth / 10 * 6; UT_uint32 ixGap = (iWidth - iMaxWidth) / 2; - points[0].x = iLeft + ixGap; - points[0].y = iyAxis - cur_linewidth / 2; + points[0].x = iLeft + ixGap + iMaxWidth - cur_linewidth * 4; + points[0].y = iyAxis - cur_linewidth * 2; - points[1].x = iLeft + ixGap + iMaxWidth - cur_linewidth * 4; - points[1].y = points[0].y; + points[1].x = iLeft + iWidth - ixGap; + points[1].y = iyAxis; - points[2].x = points[1].x; - points[2].y = points[0].y - cur_linewidth * 2; + points[2].x = points[0].x; + points[2].y = iyAxis + cur_linewidth * 2; - points[3].x = iLeft + iWidth - ixGap; - points[3].y = iyAxis; + points[3].x = points[0].x; + points[3].y = points[0].y; - points[4].x = points[1].x; - points[4].y = iyAxis + cur_linewidth * 2; + m_pG->polygon(m_colorFG,points,NPOINTS); + m_pG->fillRect(m_colorFG,iLeft + ixGap,iyAxis - cur_linewidth / 2,iMaxWidth - cur_linewidth * 4,cur_linewidth); - points[5].x = points[1].x; - points[5].y = iyAxis + cur_linewidth / 2; - - points[6].x = points[0].x; - points[6].y = points[5].y; - - points[7].x = points[0].x; - points[7].y = points[0].y; - - m_pG->setColor(m_colorFG); - m_pG->polyLine(points,NPOINTS); FREEP(points); }