diff --git a/Common/Gfx/CanvasD2D.cpp b/Common/Gfx/CanvasD2D.cpp index 8f740381..2df1ed2f 100644 --- a/Common/Gfx/CanvasD2D.cpp +++ b/Common/Gfx/CanvasD2D.cpp @@ -244,20 +244,13 @@ bool CanvasD2D::IsTransparentPixel(int x, int y) return transparent; } -D2D1::Matrix3x2F CanvasD2D::GetCurrentTransform() +D2D1_MATRIX_3X2_F CanvasD2D::GetCurrentTransform() { - D2D1::Matrix3x2F dMatrix = D2D1::Matrix3x2F::Identity(); - Gdiplus::Matrix gMatrix; - - if (Gdiplus::Ok == m_GdipGraphics->GetTransform(&gMatrix)) - { - float m[6]; - gMatrix.GetElements(m); - - dMatrix = D2D1::Matrix3x2F(m[0], m[1], m[2], m[3], m[4], m[5]); - } - - return dMatrix; + D2D1_MATRIX_3X2_F d2dMatrix; + Gdiplus::Matrix gdipMatrix; + m_GdipGraphics->GetTransform(&gdipMatrix); + gdipMatrix.GetElements((Gdiplus::REAL*)&d2dMatrix); + return d2dMatrix; } void CanvasD2D::SetTransform(const Gdiplus::Matrix& matrix) diff --git a/Common/Gfx/CanvasD2D.h b/Common/Gfx/CanvasD2D.h index 1f4c9955..198b7bf2 100644 --- a/Common/Gfx/CanvasD2D.h +++ b/Common/Gfx/CanvasD2D.h @@ -84,7 +84,7 @@ private: void EndTargetDraw(); // Retrieves current GDI+ transform (if any) and converts to a D2D Matrix - D2D1::Matrix3x2F GetCurrentTransform(); + D2D1_MATRIX_3X2_F GetCurrentTransform(); ID2D1RenderTarget* m_Target; WICBitmapDIB m_Bitmap;