User more easily understandable names for the radial gradient coordinate parameters in wxGraphicsPenInfo

This commit is contained in:
Robin Dunn
2019-08-26 20:24:07 -07:00
committed by Robin Dunn
parent 78c1c6ca6d
commit 80f24d9e74
7 changed files with 33 additions and 29 deletions

View File

@@ -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; }

View File

@@ -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;

View File

@@ -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;
};

View File

@@ -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());

View File

@@ -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);

View File

@@ -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());

View File

@@ -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());