mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
CComponentsItem: add setXPos/setYPos(), that consider real position
This commit is contained in:
@@ -194,16 +194,30 @@ bool CComponentsItem::isAdded()
|
||||
return false;
|
||||
}
|
||||
|
||||
inline void CComponentsItem::setXPos(const int& xpos)
|
||||
{
|
||||
x = xpos;
|
||||
if (cc_parent)
|
||||
setRealXPos(cc_parent->getRealXPos() + x);
|
||||
}
|
||||
|
||||
inline void CComponentsItem::setYPos(const int& ypos)
|
||||
{
|
||||
y = ypos;
|
||||
if (cc_parent)
|
||||
setRealYPos(cc_parent->getRealYPos() + y);
|
||||
}
|
||||
|
||||
void CComponentsItem::setXPosP(const uint8_t& xpos_percent)
|
||||
{
|
||||
int x_tmp = cc_parent ? xpos_percent*cc_parent->getWidth() : xpos_percent*frameBuffer->getScreenWidth();
|
||||
x = x_tmp/100;
|
||||
setXPos(x_tmp/100);
|
||||
}
|
||||
|
||||
void CComponentsItem::setYPosP(const uint8_t& ypos_percent)
|
||||
{
|
||||
int y_tmp = cc_parent ? ypos_percent*cc_parent->getHeight() : ypos_percent*frameBuffer->getScreenHeight();
|
||||
x = y_tmp/100;
|
||||
setYPos(y_tmp/100);
|
||||
}
|
||||
|
||||
void CComponentsItem::setPosP(const uint8_t& xpos_percent, const uint8_t& ypos_percent)
|
||||
|
Reference in New Issue
Block a user