summaryrefslogtreecommitdiff
path: root/dw/image.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/image.cc')
-rw-r--r--dw/image.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/dw/image.cc b/dw/image.cc
index 74f96e57..5df6b93e 100644
--- a/dw/image.cc
+++ b/dw/image.cc
@@ -428,8 +428,10 @@ void Image::setBuffer (core::Imgbuf *buffer, bool resize)
if (resize)
queueResize (0, true);
- if (wasAllocated () && getContentWidth () > 0 && getContentHeight () > 0) {
- // Only scale when both dimensions are known.
+ if (wasAllocated () && needsResize () &&
+ getContentWidth () > 0 && getContentHeight () > 0) {
+ // Don't create a new buffer for the transition from alt text to img,
+ // and only scale when both dimensions are known.
this->buffer =
buffer->getScaledBuf (getContentWidth (), getContentHeight ());
} else {