diff --git a/interface/wx/graphics.h b/interface/wx/graphics.h index cc6feb5d90..5a78b3434f 100644 --- a/interface/wx/graphics.h +++ b/interface/wx/graphics.h @@ -1525,10 +1525,21 @@ class wxGraphicsMatrix : public wxGraphicsObject public: /** Concatenates the matrix passed with the current matrix. + The effect of the resulting transformation is to first apply + the transformation in @a t to the coordinates and then apply + the transformation in the current matrix to the coordinates. + + @code + // matrix = t x matrix + @endcode + + @param t + The parameter matrix is the multiplicand. */ virtual void Concat(const wxGraphicsMatrix* t); + /** - Concatenates the matrix passed with the current matrix. + @overload */ void Concat(const wxGraphicsMatrix& t); diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index 916f047b5a..3f51a72e9d 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -915,7 +915,12 @@ wxD2DMatrixData::wxD2DMatrixData(wxGraphicsRenderer* renderer, const D2D1::Matri void wxD2DMatrixData::Concat(const wxGraphicsMatrixData* t) { - m_matrix.SetProduct(m_matrix, static_cast(t)->m_matrix); + // Elements of resulting matrix are modified in-place in SetProduct() + // so multiplied matrices cannot be the instances of the resulting matrix. + // Note that parameter matrix (t) is the multiplicand. + const D2D1::Matrix3x2F m1(static_cast(t)->m_matrix); + const D2D1::Matrix3x2F m2(m_matrix); + m_matrix.SetProduct(m1, m2); } void wxD2DMatrixData::Set(wxDouble a, wxDouble b, wxDouble c, wxDouble d, wxDouble tx, wxDouble ty)