summaryrefslogtreecommitdiff
path: root/xml/object.c
diff options
context:
space:
mode:
authorChristian Tusche <chr13@gmx.net>2007-05-06 17:26:51 +0200
committerThomas Günther <tom@toms-cafe.de>2009-06-04 00:40:07 +0200
commit0b3f86344a87940d324695e0bc9449c35cbf60d4 (patch)
treef4562fbc169695101eaab3bc25e813fc0f0c761a /xml/object.c
parentac64ce03ec6b5766691ff2da3af6f51ed800792a (diff)
downloadvdr-plugin-text2skin-0b3f86344a87940d324695e0bc9449c35cbf60d4.tar.gz
vdr-plugin-text2skin-0b3f86344a87940d324695e0bc9449c35cbf60d4.tar.bz2
2007-05-06: Version 1.1-cvs_ext-0.10a (text2skin-1.1-cvs_ext-0.10a.diff)
- increased efficiency in drawing list items in the main menu - introduce relative Pos and Size of objects to given BasePos, BaseSize (used to draw list items)
Diffstat (limited to 'xml/object.c')
-rw-r--r--xml/object.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/xml/object.c b/xml/object.c
index c63c2ea..81dc854 100644
--- a/xml/object.c
+++ b/xml/object.c
@@ -155,18 +155,25 @@ const cFont *cxObject::Font(void) const
return cFont::GetFont(fontOsd);
}
-txPoint cxObject::Pos(void) const
+txPoint cxObject::Pos(const txPoint &BaseOffset, const txSize &BaseSize) const
{
- return txPoint(mSkin->BaseOffset().x + (mPos1.x < 0 ? Skin()->BaseSize().w + mPos1.x : mPos1.x),
- mSkin->BaseOffset().y + (mPos1.y < 0 ? Skin()->BaseSize().h + mPos1.y : mPos1.y));
+ txPoint bOffset = BaseOffset.x < 0 ? mSkin->BaseOffset() : BaseOffset;
+ txSize bSize = BaseSize.w < 0 ? mSkin->BaseSize() : BaseSize;
+
+ return txPoint(bOffset.x + (mPos1.x < 0 ? bSize.w + mPos1.x : mPos1.x),
+ bOffset.y + (mPos1.y < 0 ? bSize.h + mPos1.y : mPos1.y));
}
-txSize cxObject::Size(void) const
+txSize cxObject::Size(const txPoint &BaseOffset, const txSize &BaseSize) const
{
- txPoint p1(mSkin->BaseOffset().x + (mPos1.x < 0 ? Skin()->BaseSize().w + mPos1.x : mPos1.x),
- mSkin->BaseOffset().y + (mPos1.y < 0 ? Skin()->BaseSize().h + mPos1.y : mPos1.y));
- txPoint p2(mSkin->BaseOffset().x + (mPos2.x < 0 ? Skin()->BaseSize().w + mPos2.x : mPos2.x),
- mSkin->BaseOffset().y + (mPos2.y < 0 ? Skin()->BaseSize().h + mPos2.y : mPos2.y));
+ txPoint bOffset = BaseOffset.x < 0 ? mSkin->BaseOffset() : BaseOffset;
+ txSize bSize = BaseSize.w < 0 ? mSkin->BaseSize() : BaseSize;
+
+ txPoint p1(bOffset.x + (mPos1.x < 0 ? bSize.w + mPos1.x : mPos1.x),
+ bOffset.y + (mPos1.y < 0 ? bSize.h + mPos1.y : mPos1.y));
+ txPoint p2(bOffset.x + (mPos2.x < 0 ? bSize.w + mPos2.x : mPos2.x),
+ bOffset.y + (mPos2.y < 0 ? bSize.h + mPos2.y : mPos2.y));
+
return txSize(p2.x - p1.x + 1, p2.y - p1.y + 1);
}