diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 1c69518f7e8..15180e6c7cd 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -715,3 +715,34 @@ GpStatus WINGDIPAPI GdipSetLineTransform(GpLineGradient *brush, return NotImplemented; } + +GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect) +{ + if(!brush || !rect) + return InvalidParameter; + + rect->X = (brush->startpoint.X < brush->endpoint.X ? brush->startpoint.X: brush->endpoint.X); + rect->Y = (brush->startpoint.Y < brush->endpoint.Y ? brush->startpoint.Y: brush->endpoint.Y); + + rect->Width = fabs(brush->startpoint.X - brush->endpoint.X); + rect->Height = fabs(brush->startpoint.Y - brush->endpoint.Y); + + return Ok; +} + +GpStatus WINGDIPAPI GdipGetLineRectI(GpLineGradient *brush, GpRect *rect) +{ + GpRectF rectF; + GpStatus ret; + + ret = GdipGetLineRect(brush, &rectF); + + if(ret == Ok){ + rect->X = roundr(rectF.X); + rect->Y = roundr(rectF.Y); + rect->Width = roundr(rectF.Width); + rect->Height = roundr(rectF.Height); + } + + return ret; +} diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 66eb23d4dab..1353a87ad38 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -306,8 +306,8 @@ @ stdcall GdipGetLineGammaCorrection(ptr ptr) @ stub GdipGetLinePresetBlend @ stub GdipGetLinePresetBlendCount -@ stub GdipGetLineRect -@ stub GdipGetLineRectI +@ stdcall GdipGetLineRect(ptr ptr) +@ stdcall GdipGetLineRectI(ptr ptr) @ stub GdipGetLineSpacing @ stub GdipGetLineTransform @ stub GdipGetLineWrapMode diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 1e04a236133..16a10b6ee3c 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -157,6 +157,8 @@ GpStatus WINGDIPAPI GdipCreateTextureIAI(GpImage*,GDIPCONST GpImageAttributes*, GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*); GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*); GpStatus WINGDIPAPI GdipGetLineGammaCorrection(GpLineGradient*,BOOL*); +GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient*,GpRectF*); +GpStatus WINGDIPAPI GdipGetLineRectI(GpLineGradient*,GpRect*); GpStatus WINGDIPAPI GdipGetPathGradientCenterColor(GpPathGradient*,ARGB*); GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient*,GpPointF*); GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient*,REAL*,REAL*);