Commit f6aac4c6 authored by AUTOMATIC's avatar AUTOMATIC

eliminate flicker for live previews

parent ce13ced5
......@@ -184,15 +184,15 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre
if(res.live_preview){
var img = new Image();
img.onload = function() {
var rect = gallery.getBoundingClientRect()
if(rect.width){
livePreview.style.width = rect.width + "px"
livePreview.style.height = rect.height + "px"
}
livePreview.innerHTML = ''
var img = new Image();
img.onload = function() {
livePreview.appendChild(img)
if(livePreview.childElementCount > 2){
livePreview.removeChild(livePreview.firstElementChild)
......
......@@ -338,6 +338,7 @@ input[type="range"]{
}
.livePreview img{
position: absolute;
object-fit: contain;
width: 100%;
height: 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment