forked from openlp/openlp
Try to get image-scaling working correctly
This commit is contained in:
parent
f7bcdcb67c
commit
cd25766b79
@ -428,7 +428,8 @@ var Display = {
|
||||
section.setAttribute("data-background", "#000");
|
||||
var img = document.createElement('img');
|
||||
img.src = slide["path"];
|
||||
img.setAttribute("style", "height: 100%; width: 100%;");
|
||||
//img.setAttribute("style", "height: 100%; width: 100%;");
|
||||
img.setAttribute("style", "max-width: 100%; height: auto; vertical-align: middle");
|
||||
section.appendChild(img);
|
||||
slidesDiv.appendChild(section);
|
||||
Display._slides[index.toString()] = index;
|
||||
|
@ -210,9 +210,10 @@ class ListPreviewWidget(QtWidgets.QTableWidget, RegistryProperties):
|
||||
pixmap = QtGui.QPixmap(str(slide['image']))
|
||||
else:
|
||||
pixmap = QtGui.QPixmap(str(slide['path']))
|
||||
pixmap_ratio = pixmap.width() / pixmap.height()
|
||||
label.setPixmap(pixmap)
|
||||
container = QtWidgets.QWidget()
|
||||
layout = AspectRatioLayout(container, self.screen_ratio)
|
||||
layout = AspectRatioLayout(container, pixmap_ratio)
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
layout.addWidget(label)
|
||||
container.setLayout(layout)
|
||||
|
Loading…
Reference in New Issue
Block a user