mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(ui): add CSimpleRegion::SetVertexGradient
This commit is contained in:
parent
066a53e667
commit
2fba6413bc
@ -143,6 +143,40 @@ void CSimpleRegion::SetVertexColor(const CImVector& color) {
|
|||||||
this->OnColorChanged(b1);
|
this->OnColorChanged(b1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimpleRegion::SetVertexGradient(ORIENTATION orientation, const CImVector& minColor, const CImVector& maxColor) {
|
||||||
|
bool b1 = false;
|
||||||
|
|
||||||
|
if (this->m_colorCount != 4) {
|
||||||
|
this->m_alphaCount = 4;
|
||||||
|
this->m_colorCount = 4;
|
||||||
|
b1 = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (orientation == ORIENTATION_VERTICAL) {
|
||||||
|
this->m_alpha[1] = minColor.a;
|
||||||
|
this->m_color[1] = minColor;
|
||||||
|
this->m_alpha[3] = minColor.a;
|
||||||
|
this->m_color[3] = minColor;
|
||||||
|
|
||||||
|
this->m_alpha[0] = maxColor.a;
|
||||||
|
this->m_color[0] = maxColor;
|
||||||
|
this->m_alpha[2] = maxColor.a;
|
||||||
|
this->m_color[2] = maxColor;
|
||||||
|
} else {
|
||||||
|
this->m_alpha[0] = minColor.a;
|
||||||
|
this->m_color[0] = minColor;
|
||||||
|
this->m_alpha[1] = minColor.a;
|
||||||
|
this->m_color[1] = minColor;
|
||||||
|
|
||||||
|
this->m_alpha[2] = maxColor.a;
|
||||||
|
this->m_color[2] = maxColor;
|
||||||
|
this->m_alpha[3] = maxColor.a;
|
||||||
|
this->m_color[3] = maxColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
this->OnColorChanged(b1);
|
||||||
|
}
|
||||||
|
|
||||||
void CSimpleRegion::SetFrame(CSimpleFrame* frame, uint32_t drawlayer, int32_t show) {
|
void CSimpleRegion::SetFrame(CSimpleFrame* frame, uint32_t drawlayer, int32_t show) {
|
||||||
if (this->m_parent == frame) {
|
if (this->m_parent == frame) {
|
||||||
if (this->m_drawlayer == drawlayer) {
|
if (this->m_drawlayer == drawlayer) {
|
||||||
|
|||||||
@ -34,6 +34,7 @@ class CSimpleRegion : public CScriptRegion {
|
|||||||
bool IsShown();
|
bool IsShown();
|
||||||
void OnRegionChanged();
|
void OnRegionChanged();
|
||||||
void SetVertexColor(const CImVector& color);
|
void SetVertexColor(const CImVector& color);
|
||||||
|
void SetVertexGradient(ORIENTATION orientation, const CImVector& minColor, const CImVector& maxColor);
|
||||||
void SetFrame(CSimpleFrame* frame, uint32_t drawlayer, int32_t show);
|
void SetFrame(CSimpleFrame* frame, uint32_t drawlayer, int32_t show);
|
||||||
void Show();
|
void Show();
|
||||||
void ShowThis();
|
void ShowThis();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user