Browse Source

sprite isVisible bug fix

Trevor Baron 7 năm trước cách đây
mục cha
commit
47d8d86ea1

+ 1 - 1
dist/preview release/what's new.md

@@ -31,7 +31,7 @@
 - Gizmo and GizmoManager classes used to manipulate meshes in a scene. Position, rotation, scale, and bounding box gizmos ([TrevorDev](https://github.com/TrevorDev))
 - Added a new `mesh.ignoreNonUniformScaling` to turn off non uniform scaling compensation ([Deltakosh](https://github.com/deltakosh))
 - AssetsManager tasks will only run when their state is INIT. It is now possible to remove a task from the assets manager ([RaananW](https://github.com/RaananW))
-- Sprite isVisible field ([TrevorDev](https://github.com/TrevorDev))
+- Added sprite isVisible field ([TrevorDev](https://github.com/TrevorDev))
 - Added support for `minScaleX`, `minScaleY`, `maxScaleX`, `maxScaleY` for particles ([Deltakosh](https://github.com/deltakosh))
 
 ### glTF Loader

+ 2 - 2
src/Sprites/babylon.spriteManager.ts

@@ -249,12 +249,12 @@
             engine.setDepthFunctionToLessOrEqual();
             effect.setBool("alphaTest", true);
             engine.setColorWrite(false);
-            engine.drawElementsType(Material.TriangleFillMode, 0, max * 6);
+            engine.drawElementsType(Material.TriangleFillMode, 0, (offset/4) * 6);
             engine.setColorWrite(true);
             effect.setBool("alphaTest", false);
 
             engine.setAlphaMode(Engine.ALPHA_COMBINE);
-            engine.drawElementsType(Material.TriangleFillMode, 0, max * 6);
+            engine.drawElementsType(Material.TriangleFillMode, 0, (offset/4) * 6);
             engine.setAlphaMode(Engine.ALPHA_DISABLE);
         }