A few corrections to bounding boxes.

This commit is contained in:
Huw D M Davies 2000-04-14 14:07:51 +00:00 committed by Alexandre Julliard
parent e5b3a693dd
commit 000facfb8d
2 changed files with 38 additions and 8 deletions

View File

@ -77,8 +77,10 @@ EMFDRV_ArcChordPie( DC *dc, INT left, INT top, INT right, INT bottom,
if(left > right) {temp = left; left = right; right = temp;}
if(top > bottom) {temp = top; top = bottom; bottom = temp;}
right--;
bottom--;
if(dc->w.GraphicsMode == GM_COMPATIBLE) {
right--;
bottom--;
}
emr.emr.iType = iType;
emr.emr.nSize = sizeof(emr);
@ -210,8 +212,10 @@ EMFDRV_Ellipse( DC *dc, INT left, INT top, INT right, INT bottom )
if(left > right) {temp = left; left = right; right = temp;}
if(top > bottom) {temp = top; top = bottom; bottom = temp;}
right--;
bottom--;
if(dc->w.GraphicsMode == GM_COMPATIBLE) {
right--;
bottom--;
}
emr.emr.iType = EMR_ELLIPSE;
emr.emr.nSize = sizeof(emr);
@ -240,8 +244,10 @@ EMFDRV_Rectangle(DC *dc, INT left, INT top, INT right, INT bottom)
if(left > right) {temp = left; left = right; right = temp;}
if(top > bottom) {temp = top; top = bottom; bottom = temp;}
right--;
bottom--;
if(dc->w.GraphicsMode == GM_COMPATIBLE) {
right--;
bottom--;
}
emr.emr.iType = EMR_RECTANGLE;
emr.emr.nSize = sizeof(emr);
@ -269,8 +275,10 @@ EMFDRV_RoundRect( DC *dc, INT left, INT top, INT right,
if(left > right) {temp = left; left = right; right = temp;}
if(top > bottom) {temp = top; top = bottom; bottom = temp;}
right--;
bottom--;
if(dc->w.GraphicsMode == GM_COMPATIBLE) {
right--;
bottom--;
}
emr.emr.iType = EMR_ROUNDRECT;
emr.emr.nSize = sizeof(emr);

View File

@ -283,6 +283,16 @@ HDC WINAPI CreateEnhMetaFileW(
physDev->emh->rclBounds.left = physDev->emh->rclBounds.top = 0;
physDev->emh->rclBounds.right = physDev->emh->rclBounds.bottom = -1;
if(rect) {
physDev->emh->rclFrame.left = rect->left;
physDev->emh->rclFrame.top = rect->top;
physDev->emh->rclFrame.right = rect->right;
physDev->emh->rclFrame.bottom = rect->bottom;
} else { /* Set this to {0,0 - -1,-1} and update it at the end */
physDev->emh->rclFrame.left = physDev->emh->rclFrame.top = 0;
physDev->emh->rclFrame.right = physDev->emh->rclFrame.bottom = -1;
}
physDev->emh->dSignature = ENHMETA_SIGNATURE;
physDev->emh->nVersion = 0x10000;
physDev->emh->nBytes = physDev->emh->nSize;
@ -351,6 +361,18 @@ HENHMETAFILE WINAPI CloseEnhMetaFile( HDC hdc /* metafile DC */ )
emr.nSizeLast = emr.emr.nSize;
EMFDRV_WriteRecord( dc, &emr.emr );
/* Update rclFrame if not initialized in CreateEnhMetaFile */
if(physDev->emh->rclFrame.left > physDev->emh->rclFrame.right) {
physDev->emh->rclFrame.left = physDev->emh->rclBounds.left *
physDev->emh->szlMillimeters.cx * 100 / physDev->emh->szlDevice.cx;
physDev->emh->rclFrame.top = physDev->emh->rclBounds.top *
physDev->emh->szlMillimeters.cy * 100 / physDev->emh->szlDevice.cy;
physDev->emh->rclFrame.right = physDev->emh->rclBounds.right *
physDev->emh->szlMillimeters.cx * 100 / physDev->emh->szlDevice.cx;
physDev->emh->rclFrame.bottom = physDev->emh->rclBounds.bottom *
physDev->emh->szlMillimeters.cy * 100 / physDev->emh->szlDevice.cy;
}
if (physDev->hFile) /* disk based metafile */
{
if (SetFilePointer(physDev->hFile, 0, NULL, FILE_BEGIN) != 0) {