- Timestamp:
- Mar 25, 2004, 3:52:32 PM (21 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/line.cpp
r10374 r10561 1 /* $Id: line.cpp,v 1.1 4 2004-01-11 11:42:18sandervl Exp $ */1 /* $Id: line.cpp,v 1.15 2004-03-25 14:52:32 sandervl Exp $ */ 2 2 /* 3 3 * Line API's … … 15 15 #include "oslibgpi.h" 16 16 #include <dcdata.h> 17 #include "region.h" 17 18 18 19 #define DBG_LOCALLOG DBG_line … … 23 24 //****************************************************************************** 24 25 //****************************************************************************** 25 VOID toWin32LineEnd(PPOINTLOS2 startPt,INT nXEnd,INT nYEnd,PPOINTLOS2 pt) 26 { 26 VOID toWin32LineEnd(pDCData pHps, PPOINTLOS2 startPt,INT nXEnd,INT nYEnd,PPOINTLOS2 pt) 27 { 28 // SvL: This breaks path creation when used as a clip region in a printer DC 29 // (offset by one for x coordinates make the rectangle not so rectangular anymore) 30 // Removing it alltogether causes nice drawing errors on the screen, so 31 // we'll simply ignore it when we're inside a path definition. 32 if(pHps->inPath) 33 { 34 LONG vertRes = hdcHeight(pHps->hwnd, pHps); 35 LONG horzRes = hdcWidth(pHps->hwnd, pHps); 36 37 // LineTo will return an error if the coordinates are outside the DC 38 pt->x = (nXEnd >= vertRes) ? vertRes-1 : nXEnd; 39 pt->y = (nYEnd >= horzRes) ? horzRes-1 : nYEnd; 40 } 41 else 27 42 if ((startPt->x != nXEnd) || (startPt->y != nYEnd)) 28 43 { … … 113 128 #endif 114 129 115 if 130 if(OSLibGpiMove(pHps,&newPoint)) 116 131 { 117 132 //CB: add metafile info … … 148 163 149 164 OSLibGpiQueryCurrentPosition(pHps,&oldPoint); 150 toWin32LineEnd( &oldPoint,nXEnd,nYEnd,&newPoint);165 toWin32LineEnd(pHps, &oldPoint,nXEnd,nYEnd,&newPoint); 151 166 152 167 if ((oldPoint.x == newPoint.x) && (oldPoint.y == newPoint.y)) … … 167 182 newPoint.x = nXEnd; 168 183 newPoint.y = nYEnd; 169 OSLibGpiMove(pHps,&newPoint); 170 } else 184 // Do not change the current position when we're defining a path. 185 // toWin32LineEnd can change the coordinates which would break up the path. 186 if (!pHps->inPath) 187 OSLibGpiMove(pHps,&newPoint); 188 } 189 else 171 190 { 172 191 SetLastError(ERROR_INVALID_HANDLE); … … 226 245 BOOL rc; 227 246 228 toWin32LineEnd( (PPOINTLOS2)&lppt[cPoints-2],lastPt.x,lastPt.y,(PPOINTLOS2)&points[cPoints-1]);247 toWin32LineEnd(pHps, (PPOINTLOS2)&lppt[cPoints-2],lastPt.x,lastPt.y,(PPOINTLOS2)&points[cPoints-1]); 229 248 rc = O32_Polyline(hdc,lppt,cPoints); 230 249 points[cPoints-1] = lastPt; … … 258 277 BOOL rc; 259 278 260 toWin32LineEnd( (PPOINTLOS2)&lppt[cCount-2],lastPt.x,lastPt.y,(PPOINTLOS2)&points[cCount-1]);279 toWin32LineEnd(pHps, (PPOINTLOS2)&lppt[cCount-2],lastPt.x,lastPt.y,(PPOINTLOS2)&points[cCount-1]); 261 280 rc = O32_PolylineTo(hdc,lppt,cCount); 262 281 points[cCount-1] = lastPt; -
trunk/src/gdi32/region.h
r10374 r10561 1 //$Id: region.h,v 1. 4 2004-01-11 11:42:22 sandervl Exp $1 //$Id: region.h,v 1.5 2004-03-25 14:52:32 sandervl Exp $ 2 2 #ifndef __REGION_H__ 3 3 #define __REGION_H__ … … 13 13 BOOL GdiDestroyRgn(pDCData pHps, HRGN hrgnClip); 14 14 15 16 LONG hdcHeight(HWND hwnd, pDCData pHps); 17 LONG hdcWidth(HWND hwnd, pDCData pHps); 18 15 19 #endif //__REGION_H__
Note:
See TracChangeset
for help on using the changeset viewer.