Selaa lähdekoodia

Canvas2D: ScaleBug wasn't completly fixed, will it be ever?

nockawa 8 vuotta sitten
vanhempi
commit
8c4e43c195
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      canvas2D/src/Engine/babylon.renderablePrim2d.ts

+ 3 - 1
canvas2D/src/Engine/babylon.renderablePrim2d.ts

@@ -932,10 +932,12 @@
         protected updateInstanceDataPart(part: InstanceDataBase, positionOffset: Vector2 = null) {
         protected updateInstanceDataPart(part: InstanceDataBase, positionOffset: Vector2 = null) {
             let t = this._globalTransform.multiply(this.renderGroup.invGlobalTransform);    // Compute the transformation into the renderGroup's space
             let t = this._globalTransform.multiply(this.renderGroup.invGlobalTransform);    // Compute the transformation into the renderGroup's space
             let actualScale = this.actualScale;
             let actualScale = this.actualScale;
+            let renderGroupScale = this.renderGroup.actualScale;
 
 
             if (!this.applyActualScaleOnTransform() || actualScale.x !== 1 || actualScale.y !== 1) {
             if (!this.applyActualScaleOnTransform() || actualScale.x !== 1 || actualScale.y !== 1) {
                 t.decompose(RenderablePrim2D._s, RenderablePrim2D._r, RenderablePrim2D._t);
                 t.decompose(RenderablePrim2D._s, RenderablePrim2D._r, RenderablePrim2D._t);
-                t = Matrix.Compose((!this.applyActualScaleOnTransform() ? RenderablePrim2D._uV3 : new Vector3(actualScale.x, actualScale.y, 1)), RenderablePrim2D._r, RenderablePrim2D._t);
+                let scale = new Vector3(actualScale.x, actualScale.y, 1);
+                t = Matrix.Compose((!this.applyActualScaleOnTransform() ? RenderablePrim2D._uV3 : scale), RenderablePrim2D._r, !this.applyActualScaleOnTransform() ? RenderablePrim2D._t : RenderablePrim2D._t.multiply(scale));
             }
             }
 
 
             //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) || !this.applyActualScaleOnTransform()) ? RenderablePrim2D._uV : this.renderGroup.actualScale;         // We still need to apply the scale of the renderGroup to our rendering, so get it.