From 3186df2b024b02eec4715d3f932903728af47156 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Mon, 6 Nov 2017 13:32:09 +0300 Subject: [PATCH] gdiplus/metafile: Implement playback for EmfPlusRecordTypeDrawEllipse. Signed-off-by: Nikolay Sivov Signed-off-by: Vincent Povirk Signed-off-by: Alexandre Julliard --- dlls/gdiplus/metafile.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/dlls/gdiplus/metafile.c b/dlls/gdiplus/metafile.c index c40097e019f..989ecd06918 100644 --- a/dlls/gdiplus/metafile.c +++ b/dlls/gdiplus/metafile.c @@ -444,6 +444,16 @@ typedef struct EmfPlusDrawArc } RectData; } EmfPlusDrawArc; +typedef struct EmfPlusDrawEllipse +{ + EmfPlusRecordHeader Header; + union + { + EmfPlusRect rect; + EmfPlusRectF rectF; + } RectData; +} EmfPlusDrawEllipse; + typedef struct EmfPlusDrawPie { EmfPlusRecordHeader Header; @@ -3091,6 +3101,26 @@ GpStatus WINGDIPAPI GdipPlayMetafileRecord(GDIPCONST GpMetafile *metafile, draw->RectData.rectF.X, draw->RectData.rectF.Y, draw->RectData.rectF.Width, draw->RectData.rectF.Height, draw->StartAngle, draw->SweepAngle); } + case EmfPlusRecordTypeDrawEllipse: + { + EmfPlusDrawEllipse *draw = (EmfPlusDrawEllipse *)header; + BYTE pen = flags & 0xff; + + if (pen >= EmfPlusObjectTableSize || real_metafile->objtable[pen].type != ObjectTypePen) + return InvalidParameter; + + if (dataSize != (flags & 0x4000 ? sizeof(EmfPlusRect) : sizeof(EmfPlusRectF))) + return InvalidParameter; + + if (flags & 0x4000) /* C */ + return GdipDrawEllipseI(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen, + draw->RectData.rect.X, draw->RectData.rect.Y, draw->RectData.rect.Width, + draw->RectData.rect.Height); + else + return GdipDrawEllipse(real_metafile->playback_graphics, real_metafile->objtable[pen].u.pen, + draw->RectData.rectF.X, draw->RectData.rectF.Y, draw->RectData.rectF.Width, + draw->RectData.rectF.Height); + } case EmfPlusRecordTypeDrawPie: { EmfPlusDrawPie *draw = (EmfPlusDrawPie *)header;