Skip to content

Commit

Permalink
libappfw|LabelWidget: Image width/height can be overridden separately
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Dec 20, 2014
1 parent eb5c6ef commit 0322974
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions doomsday/libappfw/src/widgets/labelwidget.cpp
Expand Up @@ -231,11 +231,17 @@ public Font::RichFormat::IStyle

Vector2f imageSize() const
{
if(overrideImageSize.x > 0 && overrideImageSize.y > 0)
Vector2f size = image.isNull()? Vector2f() : image->size();
// Override components separately.
if(overrideImageSize.x > 0)
{
return overrideImageSize;
size.x = overrideImageSize.x;
}
return image.isNull()? Vector2f() : image->size();
if(overrideImageSize.y > 0)
{
size.y = overrideImageSize.y;
}
return size;
}

Vector2ui textSize() const
Expand Down

0 comments on commit 0322974

Please sign in to comment.