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 Sat Jul 15 08:53:43 2000 +++ abi.pow\src\/af/gr/win/gr_Win32Graphics.cpp Sat Jul 15 13:48:54 2000 @@ -779,4 +779,31 @@ UINT d = m_tm.tmDefaultChar; m_cw.setCharWidthsOfRange(hdc,d,d); m_defaultCharWidth = m_cw.getWidth(d); +} + +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); } 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 Sat Jul 08 11:25:57 2000 +++ abi.pow\src\/af/gr/win/gr_Win32Graphics.h Sat Jul 15 13:49:35 2000 @@ -123,7 +123,7 @@ UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h); virtual void fillRect(GR_Color3D c, UT_Rect &r); - + virtual void polygon(UT_RGBColor& c,UT_Point *pts,UT_uint32 nPoints); protected: virtual UT_uint32 _getResolution(void) const; void _setColor(DWORD clrRef); 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 Sat Jul 15 08:53:44 2000 +++ abi.pow\src\/af/gr/xp/gr_Graphics.cpp Sat Jul 15 13:50:16 2000 @@ -343,3 +343,37 @@ return vectorImage; } + +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 Mon Jul 10 08:52:13 2000 +++ abi.pow\src\/af/gr/xp/gr_Graphics.h Sat Jul 15 13:51:20 2000 @@ -192,7 +192,7 @@ // I jusy can't think of one right now. UT_uint32 m_iRasterPosition; - + virtual void polygon(UT_RGBColor& c,UT_Point *pts,UT_uint32 nPoints); protected: virtual UT_uint32 _getResolution(void) const = 0; @@ -209,6 +209,8 @@ static XAP_PrefsScheme *m_pPrefsScheme; static UT_uint32 m_uTick; +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 Fri Jul 14 08:05:24 2000 +++ abi.pow\src\/text/fmt/xp/fp_Run.cpp Sat Jul 15 14:00:49 2000 @@ -462,7 +462,7 @@ return; } - #define NPOINTS 8 + #define NPOINTS 4 UT_Point points[NPOINTS]; @@ -471,32 +471,20 @@ 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; - - 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); + m_pG->polygon(m_colorFG,points,NPOINTS); + m_pG->fillRect(m_colorFG,iLeft + ixGap,iyAxis - cur_linewidth / 2,iMaxWidth - cur_linewidth * 4,cur_linewidth); } void fp_TabRun::_draw(dg_DrawArgs* pDA)