فهرست منبع

Merge pull request #2269 from abow/canvas2DFixes

fixes #1929 - stops prim from drifting when animated and margin is no…
David Catuhe 8 سال پیش
والد
کامیت
1b39896670
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      canvas2D/src/Engine/babylon.prim2dBase.ts

+ 4 - 0
canvas2D/src/Engine/babylon.prim2dBase.ts

@@ -4146,6 +4146,10 @@
                         hasV = true;
                         setSize = true;
                     }
+                }else{
+                    //this prevents the prim from flying off the screen when margin is not set (bug #1929)
+                    this._marginOffset.x = 0;
+                    this._marginOffset.y = 0;
                 }
 
                 if (!hasH) {