cache parameter removed, only the folder preview images were cached, cache them in that class

This commit is contained in:
2016-02-10 08:59:33 +01:00
parent 348767c8e8
commit f48f81ecef
4 changed files with 15 additions and 19 deletions
@@ -26,6 +26,7 @@ import com.jpexs.decompiler.flash.tags.base.DrawableTag;
import com.jpexs.decompiler.flash.tags.base.ImageTag;
import com.jpexs.decompiler.flash.tags.base.RenderContext;
import com.jpexs.decompiler.flash.timeline.Frame;
import com.jpexs.decompiler.flash.timeline.Timeline;
import com.jpexs.decompiler.flash.treeitems.TreeItem;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.helpers.Cache;
@@ -307,7 +308,15 @@ public class FolderPreviewPanel extends JPanel {
zoom = ratio;
}
}
imgSrc = SWF.frameToImageGet(swf.getTimeline(), fn.frame, fn.frame, null, 0, rect, new Matrix(), new Matrix(), null, null, true, zoom);
Timeline timeline = swf.getTimeline();
String key = "frame_" + fn.frame + "_" + timeline.id + "_" + zoom;
imgSrc = swf.getFromCache(key);
if (imgSrc == null) {
imgSrc = SWF.frameToImageGet(timeline, fn.frame, fn.frame, null, 0, rect, new Matrix(), new Matrix(), null, null, zoom);
swf.putToCache(key, imgSrc);
}
width = imgSrc.getWidth();
height = imgSrc.getHeight();
} else if (treeItem instanceof ImageTag) {