diff --git a/src/gui/guiTable.cpp b/src/gui/guiTable.cpp index e62a838f9773f..0e79f1dbdf3fc 100644 --- a/src/gui/guiTable.cpp +++ b/src/gui/guiTable.cpp @@ -381,9 +381,10 @@ void GUITable::setTable(const TableOptions &options, row->content_width = 0; if (image) { - // Fit into row s32 max_height = std::clamp(m_rowheight - 2 * vpadding, 1, m_rowheight); - row->image_scale = (f32)max_height / (f32)image->getOriginalSize().Height; + f32 max_image_scale = (f32)max_height / (f32)image->getOriginalSize().Height; + // Scale with display density, but make sure it fits into the row + row->image_scale = std::min(density, max_image_scale); // When upscaling, only allow integer multiples if (row->image_scale > 1.0f) row->image_scale = std::floor(row->image_scale);