Fix animated texture preview in single tex mode

This commit is contained in:
JannisX11 2021-06-16 16:28:59 +02:00
parent e4f9b8cf60
commit dc25b713d5
2 changed files with 10 additions and 7 deletions

View File

@ -203,6 +203,11 @@ function setProjectResolution(width, height, modify_uv) {
}
function updateProjectResolution() {
document.querySelector('#project_resolution_status').textContent = `${Project.texture_width}${Project.texture_height}`;
if (Texture.selected) {
// Update animated textures
Texture.selected.height++;
Texture.selected.height--;
}
}

View File

@ -830,13 +830,11 @@ const Canvas = {
stretch = 1;
frame = 0;
if (cube.faces[f.face].texture && cube.faces[f.face].texture !== null) {
var tex = cube.faces[f.face].getTexture()
if (tex instanceof Texture && tex.frameCount !== 1) {
stretch = tex.frameCount
if (animation === true && tex.currentFrame) {
frame = tex.currentFrame
}
let tex = cube.faces[f.face].getTexture();
if (tex instanceof Texture && tex.frameCount !== 1) {
stretch = tex.frameCount
if (animation === true && tex.currentFrame) {
frame = tex.currentFrame
}
}