From 45ad42a889d4261c49d27513244bcf30cab70630 Mon Sep 17 00:00:00 2001
From: Christopher Pietsch <cpietsch@gmail.com>
Date: Fri, 24 Apr 2020 13:32:51 +0200
Subject: [PATCH] fixed ghost bug for large images

---
 js/canvas.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/js/canvas.js b/js/canvas.js
index 0e981bf..f23a262 100644
--- a/js/canvas.js
+++ b/js/canvas.js
@@ -864,16 +864,20 @@ function Canvas() {
     var sprite = new PIXI.Sprite(texture);
     var res = config.loader.textures.big.size;
 
-    var updateSize = function () {
+    var updateSize = function (t) {
       var size = Math.max(texture.width, texture.height);
       sprite.scale.x = sprite.scale.y = (imageSize3 / size) * d.scaleFactor;
       sleep = false;
+      if(t.valid){
+        d.alpha = 0;
+        d.alpha2 = 0;
+      }
     };
 
     sprite.on("added", updateSize);
     texture.once("update", updateSize);
 
-    if (d.imagenum) {
+    if (d.imagenum > 1) {
       sprite.on("mousemove", function (s) {
         var pos = s.data.getLocalPosition(s.currentTarget);
         s.currentTarget.cursor = pos.x > 0 ? "e-resize" : "w-resize";
-- 
GitLab