diff options
author | corvid <corvid@lavabit.com> | 2010-03-03 18:55:02 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2010-03-03 18:55:02 +0000 |
commit | 2e8e9e1ff52df336f5126082b2792934f022e5cc (patch) | |
tree | d1fea328418bbdd4ed5e63b4f19c299df65408ae /dw | |
parent | 7e200117f6e4156a0375ef7eb3deaa9f2d626847 (diff) |
fix alt text clipping
Since an image's descent is (at least currently) 0, it was less than
the font's descent, causing unnecessary clipping.
Diffstat (limited to 'dw')
-rw-r--r-- | dw/image.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/dw/image.cc b/dw/image.cc index d68ef94a..457fe8d8 100644 --- a/dw/image.cc +++ b/dw/image.cc @@ -354,16 +354,14 @@ void Image::draw (core::View *view, core::Rectangle *area) layout->textWidth (getStyle()->font, altText, strlen (altText)); core::View *clippingView = NULL, *usedView = view; - if (allocation.width < altTextWidth || - allocation.ascent < getStyle()->font->ascent || - allocation.descent < getStyle()->font->descent) { + if ((getContentWidth() < altTextWidth) || + (getContentHeight() < + getStyle()->font->ascent + getStyle()->font->descent)) { clippingView = usedView = view->getClippingView (allocation.x + getStyle()->boxOffsetX (), allocation.y + getStyle()->boxOffsetY (), - allocation.width - - getStyle()->boxDiffWidth (), - allocation.ascent + allocation.descent - - getStyle()->boxDiffHeight ()); + getContentWidth(), + getContentHeight()); } usedView->drawText (getStyle()->font, getStyle()->color, |