summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/bitmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/bitmap.cpp')
-rw-r--r--src/lib/util/bitmap.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/util/bitmap.cpp b/src/lib/util/bitmap.cpp
index fc05b89f1b6..cfad01ac82f 100644
--- a/src/lib/util/bitmap.cpp
+++ b/src/lib/util/bitmap.cpp
@@ -280,23 +280,25 @@ void bitmap_t::resize(int width, int height, int xslop, int yslop)
int new_rowpixels = compute_rowpixels(width, xslop);
uint32_t new_allocbytes = new_rowpixels * (height + 2 * yslop) * m_bpp / 8;
- // if we need more memory, just realloc
if (new_allocbytes > m_allocbytes)
{
- palette_t *palette = m_palette;
+ // if we need more memory, just realloc
+ palette_t *const palette = m_palette;
allocate(width, height, xslop, yslop);
set_palette(palette);
- return;
}
+ else
+ {
- // otherwise, reconfigure
- m_rowpixels = new_rowpixels;
- m_width = width;
- m_height = height;
- m_cliprect.set(0, width - 1, 0, height - 1);
+ // otherwise, reconfigure
+ m_rowpixels = new_rowpixels;
+ m_width = width;
+ m_height = height;
+ m_cliprect.set(0, width - 1, 0, height - 1);
- // re-compute the base
- compute_base(xslop, yslop);
+ // re-compute the base
+ compute_base(xslop, yslop);
+ }
}
/**