Fix image lookups for animated layers (#928)

This commit is contained in:
jberg 2019-09-14 19:41:46 -07:00 committed by Jordan Eldredge
parent 59281e056f
commit baa83eed61
3 changed files with 6 additions and 5 deletions

View file

@ -354,7 +354,7 @@ function animatedLayerOffsetAndSize(
function AnimatedLayer({
node,
id,
image,
js_assets,
x,
y,
w,
@ -362,12 +362,12 @@ function AnimatedLayer({
framewidth,
frameheight,
}) {
if (image == null) {
const img = js_assets.image;
if (img == null) {
console.warn("Got an AnimatedLayer without an image. Rendering null", id);
return null;
}
const img = node.js_imageLookup(image.toLowerCase());
const frameNum = node.getcurframe();
let style = {};

View file

@ -44,7 +44,8 @@ async function prepareMakiImage(node, zip, file) {
function imageAttributesFromNode(node) {
if (!node.name) return [];
switch (node.name.toLowerCase()) {
case "layer": {
case "layer":
case "animatedlayer": {
return ["image"];
}
case "layout": {

View file

@ -55,7 +55,7 @@ class AnimatedLayer extends Layer {
return;
}
const image = this.js_imageLookup(attributes.image);
const image = attributes.js_assets.image;
if (!image) {
console.warn("Could not find image: ", attributes.image);
return;