Fixed display of generic media with small width.

This commit is contained in:
23rd 2024-10-18 04:10:24 +03:00 committed by John Preston
parent 9e76e64064
commit 1a1e777b87

View file

@ -110,7 +110,13 @@ QSize MediaGeneric::countOptimalSize() {
}
QSize MediaGeneric::countCurrentSize(int newWidth) {
return { maxWidth(), minHeight() };
if (newWidth > maxWidth()) {
newWidth = maxWidth();
}
for (auto &entry : _entries) {
entry.object->resizeGetHeight(newWidth);
}
return { newWidth, minHeight() };
}
void MediaGeneric::draw(Painter &p, const PaintContext &context) const {