From 80f24d9e74a98c940e90b224cdefd0b4735489cb Mon Sep 17 00:00:00 2001 From: Robin Dunn <> Date: Mon, 26 Aug 2019 20:24:07 -0700 Subject: [PATCH] User more easily understandable names for the radial gradient coordinate parameters in wxGraphicsPenInfo --- include/wx/graphics.h | 30 ++++++++++++++++-------------- include/wx/motif/cursor.h | 2 +- interface/wx/graphics.h | 14 ++++++++------ src/generic/graphicc.cpp | 4 ++-- src/msw/graphics.cpp | 4 ++-- src/msw/graphicsd2d.cpp | 4 ++-- src/osx/carbon/graphics.cpp | 4 ++-- 7 files changed, 33 insertions(+), 29 deletions(-) diff --git a/include/wx/graphics.h b/include/wx/graphics.h index 13926d144a..9f71f7cd60 100644 --- a/include/wx/graphics.h +++ b/include/wx/graphics.h @@ -403,15 +403,16 @@ public: } wxGraphicsPenInfo& - RadialGradient(wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, + RadialGradient(wxDouble startX, wxDouble startY, + wxDouble endX, wxDouble endY, wxDouble radius, const wxColour& oColor, const wxColour& cColor, const wxGraphicsMatrix& matrix=wxNullGraphicsMatrix) { m_gradientType = wxGRADIENT_RADIAL; - m_x1 = xo; - m_y1 = yo; - m_x2 = xc; - m_y2 = yc; + m_x1 = startX; + m_y1 = startY; + m_x2 = endX; + m_y2 = endY; m_radius = radius; m_stops.SetStartColour(oColor); m_stops.SetEndColour(cColor); @@ -420,15 +421,16 @@ public: } wxGraphicsPenInfo& - RadialGradient(wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, + RadialGradient(wxDouble startX, wxDouble startY, + wxDouble endX, wxDouble endY, wxDouble radius, const wxGraphicsGradientStops& stops, const wxGraphicsMatrix& matrix=wxNullGraphicsMatrix) { m_gradientType = wxGRADIENT_RADIAL; - m_x1 = xo; - m_y1 = yo; - m_x2 = xc; - m_y2 = yc; + m_x1 = startX; + m_y1 = startY; + m_x2 = endX; + m_y2 = endY; m_radius = radius; m_stops = stops; m_matrix = matrix; @@ -443,10 +445,10 @@ public: wxDouble GetY1() const { return m_y1; } wxDouble GetX2() const { return m_x2; } wxDouble GetY2() const { return m_y2; } - wxDouble GetXO() const { return m_x1; } - wxDouble GetYO() const { return m_y1; } - wxDouble GetXC() const { return m_x2; } - wxDouble GetYC() const { return m_y2; } + wxDouble GetStartX() const { return m_x1; } + wxDouble GetStartY() const { return m_y1; } + wxDouble GetEndX() const { return m_x2; } + wxDouble GetEndY() const { return m_y2; } wxDouble GetRadius() const { return m_radius; } const wxGraphicsGradientStops& GetStops() const { return m_stops; } const wxGraphicsMatrix& GetMatrix() const { return m_matrix; } diff --git a/include/wx/motif/cursor.h b/include/wx/motif/cursor.h index 0658abc6ec..0cce9a83a1 100644 --- a/include/wx/motif/cursor.h +++ b/include/wx/motif/cursor.h @@ -43,7 +43,7 @@ public: // Motif-specific. // Create/get a cursor for the current display - WXCursor GetXCursor(WXDisplay* display) const; + WXCursor GetEndXursor(WXDisplay* display) const; protected: virtual wxGDIRefData *CreateGDIRefData() const; diff --git a/interface/wx/graphics.h b/interface/wx/graphics.h index b9ebcb4a02..6901f0ea43 100644 --- a/interface/wx/graphics.h +++ b/interface/wx/graphics.h @@ -1645,12 +1645,14 @@ public: const wxGraphicsMatrix& matrix=wxNullGraphicsMatrix); wxGraphicsPenInfo& - RadialGradient(wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, + RadialGradient(wxDouble startX, wxDouble startY, + wxDouble endX, wxDouble endY, wxDouble radius, const wxColour& oColor, const wxColour& cColor, const wxGraphicsMatrix& matrix=wxNullGraphicsMatrix); wxGraphicsPenInfo& - RadialGradient(wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, + RadialGradient(wxDouble startX, wxDouble startY, + wxDouble endX, wxDouble endY, wxDouble radius, const wxGraphicsGradientStops& stops, const wxGraphicsMatrix& matrix=wxNullGraphicsMatrix); @@ -1669,10 +1671,10 @@ public: wxDouble GetY1() const; wxDouble GetX2() const; wxDouble GetY2() const; - wxDouble GetXO() const; - wxDouble GetYO() const; - wxDouble GetXC() const; - wxDouble GetYC() const; + wxDouble GetStartX() const; + wxDouble GetStartY() const; + wxDouble GetEndX() const; + wxDouble GetEndY() const; wxDouble GetRadius() const; const wxGraphicsGradientStops& GetStops() const; }; diff --git a/src/generic/graphicc.cpp b/src/generic/graphicc.cpp index 5366b8ac1e..7674e11370 100644 --- a/src/generic/graphicc.cpp +++ b/src/generic/graphicc.cpp @@ -943,8 +943,8 @@ wxCairoPenData::wxCairoPenData( wxGraphicsRenderer* renderer, const wxGraphicsPe break; case wxGRADIENT_RADIAL: - CreateRadialGradientPattern(info.GetXO(), info.GetYO(), - info.GetXC(), info.GetYC(), + CreateRadialGradientPattern(info.GetStartX(), info.GetStartY(), + info.GetEndX(), info.GetEndY(), info.GetRadius(), info.GetStops(), info.GetMatrix()); diff --git a/src/msw/graphics.cpp b/src/msw/graphics.cpp index 9313f99e75..a8644d3e07 100644 --- a/src/msw/graphics.cpp +++ b/src/msw/graphics.cpp @@ -996,8 +996,8 @@ wxGDIPlusPenData::wxGDIPlusPenData( wxGraphicsRenderer* renderer, case wxGRADIENT_RADIAL: if (m_brush) delete m_brush; - CreateRadialGradientBrush(info.GetXO(), info.GetYO(), - info.GetXC(), info.GetYC(), + CreateRadialGradientBrush(info.GetStartX(), info.GetStartY(), + info.GetEndX(), info.GetEndY(), info.GetRadius(), info.GetStops()); m_pen->SetBrush(m_brush); diff --git a/src/msw/graphicsd2d.cpp b/src/msw/graphicsd2d.cpp index 07c242ddf3..67febac98d 100644 --- a/src/msw/graphicsd2d.cpp +++ b/src/msw/graphicsd2d.cpp @@ -2741,8 +2741,8 @@ wxD2DPenData::wxD2DPenData( case wxGRADIENT_RADIAL: m_stippleBrush = new wxD2DBrushData(renderer); m_stippleBrush->CreateRadialGradientBrush( - m_penInfo.GetXO(), m_penInfo.GetYO(), - m_penInfo.GetXC(), m_penInfo.GetYC(), + m_penInfo.GetStartX(), m_penInfo.GetStartY(), + m_penInfo.GetEndX(), m_penInfo.GetEndY(), m_penInfo.GetRadius(), m_penInfo.GetStops(), m_penInfo.GetMatrix()); diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index 5e2c89e3d7..9d48d2f106 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -870,8 +870,8 @@ wxMacCoreGraphicsPenData::wxMacCoreGraphicsPenData( wxGraphicsRenderer* renderer break; case wxGRADIENT_RADIAL: - CreateRadialGradientShading(info.GetXO(), info.GetYO(), - info.GetXC(), info.GetYC(), + CreateRadialGradientShading(info.GetStartX(), info.GetStartY(), + info.GetEndX(), info.GetEndY(), info.GetRadius(), info.GetStops(), info.GetMatrix());