Skip to content

Commit

Permalink
MythUI: Make ascent/descent/bearing adjustment a little easier to fol…
Browse files Browse the repository at this point in the history
…low, by using moveTop/moveLeft instead of setX/setY
  • Loading branch information
jpoet committed Mar 2, 2012
1 parent d16575c commit 55fd3bf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions mythtv/libs/libmythui/mythuitext.cpp
Expand Up @@ -361,8 +361,8 @@ void MythUIText::DrawSelf(MythPainter *p, int xoffset, int yoffset,
if (m_Ascent)
{
drawrect.setY(drawrect.y() - m_Ascent);
canvas.setY(canvas.y() + m_Ascent);
canvas.setHeight(canvas.height() + (m_Ascent * 2));
canvas.moveTop(canvas.y() + m_Ascent);
canvas.setHeight(canvas.height() + m_Ascent);
}
if (m_Descent)
{
Expand All @@ -373,8 +373,8 @@ void MythUIText::DrawSelf(MythPainter *p, int xoffset, int yoffset,
if (m_leftBearing)
{
drawrect.setX(drawrect.x() + m_leftBearing);
canvas.setX(canvas.x() - m_leftBearing);
canvas.setWidth(canvas.width() - (m_leftBearing * 2));
canvas.moveLeft(canvas.x() - m_leftBearing);
canvas.setWidth(canvas.width() - m_leftBearing);
}
if (m_rightBearing)
{
Expand Down Expand Up @@ -412,10 +412,10 @@ void MythUIText::DrawSelf(MythPainter *p, int xoffset, int yoffset,

/* Canvas pos is where the view port (drawrect) pulls from, so
* it needs moved to the right for the left edge to be picked up*/
canvas.setX(canvas.x() + outline.x());
canvas.setWidth(canvas.width() + (outline.x() * 2));
canvas.setY(canvas.y() + outline.y());
canvas.setHeight(canvas.height() + (outline.y() * 2));
canvas.moveLeft(canvas.x() + outline.x());
canvas.setWidth(canvas.width() + outline.x());
canvas.moveTop(canvas.y() + outline.y());
canvas.setHeight(canvas.height() + outline.y());
}

if (GetFontProperties()->hasShadow())
Expand Down

0 comments on commit 55fd3bf

Please sign in to comment.