瀏覽代碼

Canvas2D fix designSize with scale (last time hopefully)

nockawa 8 年之前
父節點
當前提交
4048cb349d
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      canvas2D/src/Engine/babylon.renderablePrim2d.ts

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

@@ -931,11 +931,11 @@
          */
         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) ? RenderablePrim2D._uV : this.renderGroup.actualScale;         // We still need to apply the scale of the renderGroup to our rendering, so get it.
+            let actualScale = this.actualScale;
 
-            if (!this.applyActualScaleOnTransform() || rgScale.x!==1 || rgScale.y!==1) {
+            if (!this.applyActualScaleOnTransform() || actualScale.x !== 1 || actualScale.y !== 1) {
                 t.decompose(RenderablePrim2D._s, RenderablePrim2D._r, RenderablePrim2D._t);
-                t = Matrix.Compose((!this.applyActualScaleOnTransform() ? RenderablePrim2D._uV3.divide(new Vector3(rgScale.x, rgScale.y, 1)) : 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 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.