Explorar o código

Canvas2D: Scale bug fixed (again!)

Hopefully things are right this time.
New preview of C2D is also included
nockawa %!s(int64=8) %!d(string=hai) anos
pai
achega
a9536c01ed

+ 12 - 2
canvas2D/src/Engine/babylon.renderablePrim2d.ts

@@ -920,7 +920,10 @@
         }
 
         private static _uV = new Vector2(1, 1);
-
+        private static _s = Vector3.Zero();
+        private static _r = Quaternion.Identity();
+        private static _t = Vector3.Zero();
+        private static _uV3 = new Vector3(1, 1, 1);
         /**
          * Update the instanceDataBase level properties of a part
          * @param part the part to update
@@ -928,7 +931,14 @@
          */
         protected updateInstanceDataPart(part: InstanceDataBase, positionOffset: Vector2 = null) {
             let t = this._globalTransform.multiply(this.renderGroup.invGlobalTransform);    // Compute the transformation into the renderGroup's space
-            let rgScale = (this._areSomeFlagsSet(SmartPropertyPrim.flagDontInheritParentScale) || !this.applyActualScaleOnTransform()) ? RenderablePrim2D._uV : this.renderGroup.actualScale;         // We still need to apply the scale of the renderGroup to our rendering, so get it.
+            let rgScale = this._areSomeFlagsSet(SmartPropertyPrim.flagDontInheritParentScale) ? RenderablePrim2D._uV : this.renderGroup.actualScale;         // We still need to apply the scale of the renderGroup to our rendering, so get it.
+
+            if (!this.applyActualScaleOnTransform()) {
+                t.decompose(RenderablePrim2D._s, RenderablePrim2D._r, RenderablePrim2D._t);
+                t = Matrix.Compose(RenderablePrim2D._uV3, RenderablePrim2D._r, RenderablePrim2D._t);
+            }
+
+            //let rgScale = (this._areSomeFlagsSet(SmartPropertyPrim.flagDontInheritParentScale) || !this.applyActualScaleOnTransform()) ? RenderablePrim2D._uV : this.renderGroup.actualScale;         // We still need to apply the scale of the renderGroup to our rendering, so get it.
             let size = (<Size>this.renderGroup.viewportSize);
             let zBias = this.actualZOffset;
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 175 - 175
dist/preview release/canvas2D/babylon.canvas2d.d.ts


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1586 - 1528
dist/preview release/canvas2D/babylon.canvas2d.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 10 - 10
dist/preview release/canvas2D/babylon.canvas2d.min.js