]> _ Git - fluidbook-html5.git/commitdiff
wip #809 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Aug 2018 14:59:21 +0000 (16:59 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 22 Aug 2018 14:59:21 +0000 (16:59 +0200)
js/libs/fluidbook/fluidbook.3dflip.js
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.support.js

index a68e711fe007f13e39356f2bb05581eaf273c644..4d648a904a275c0ddbd90771f78e4060748f6851 100644 (file)
@@ -25,18 +25,18 @@ function Fluidbook3DFlip(fluidbook) {
     this.enableLight = !this.lowPerf;
     this.enableShadow = !this.lowPerf && this.enableLight;
     this.antialias = false;
+    this.animationTime = parseFloat(this.fluidbook.datas.mobileTransitionDuration);
     if (this.veryLowPerf) {
         this.qualityRatio = .7;
         this.triangles = 1;
-        this.animationTime = parseFloat(this.fluidbook.datas.mobileTransitionDuration) / 1.5;
+        this.animationTime /= 1.5;
     } else if (this.lowPerf) {
         this.qualityRatio = 1.2;
         this.triangles = 2;
-        this.animationTime = parseFloat(this.fluidbook.datas.mobileTransitionDuration) / 1.25;
+        this.animationTime /= 1.25;
     } else {
         this.qualityRatio = 2;
         this.triangles = 5;
-        this.animationTime = parseFloat(this.fluidbook.datas.mobileTransitionDuration);
     }
     this.pixelRatio = window.devicePixelRatio * this.qualityRatio;
 
@@ -95,7 +95,6 @@ Fluidbook3DFlip.prototype = {
                 light.shadow.bias = -0.0075;
                 light.shadow.radius = 3;
             }
-
             this.scene.add(light);
         }
 
index ae2dfb531d66b39f66bca7a3c5cfd83b2c57d6a0..b37a2a6e9369ad321088479ea068baa3b9de2b71 100644 (file)
@@ -330,12 +330,16 @@ FluidbookLoader.prototype = {
         ctx.drawImage(this.backgrounds[page].get(0), 0, 0, d, d);
         // Draw the texts if necessary
         if (this.getVersionToLoad(page) === 'textasvector') {
-            ctx.drawImage(this.texts[page].get(0), 0, 0, d, d);
+            try {
+                ctx.drawImage(this.texts[page].get(0), 0, 0, d, d);
+            } catch (e) {
+
+            }
         }
 
         // Draw the shadow if necessary
         if (this.fluidbook.datas.shadeAlpha > 0) {
-            var sw = 1024 / 3;
+            var sw = 1024 * .25;
             var s, x;
             if (page % 2 === 0) {
                 // Left
@@ -346,7 +350,7 @@ FluidbookLoader.prototype = {
                 s = this.shadeRight;
                 x = 0;
             }
-            ctx.globalAlpha = this.fluidbook.datas.shadeAlpha / 100;
+            ctx.globalAlpha = 2 * this.fluidbook.datas.shadeAlpha / 100;
             ctx.drawImage(s.get(0), x, 0, sw, d);
             ctx.globalAlpha = 1;
         }
index c16d110a29dd873dfd8b0d299d0419695442bf80..cc3616610dabed1d4b4e69560852d0bc5d898e66 100644 (file)
@@ -22,7 +22,7 @@ function FluidbookSupport(fluidbook) {
             this.imagesVersion = true;
             break;
         case 'html5-desktop':
-            this.imagesVersion = this.iOS || this.android;
+            this.imagesVersion = this.iOS || this.android || this.IE > 0;
             break;
         default:
             this.imagesVersion = false;