Skip to content

Commit 52ba6fa

Browse files
committed
fix skew/filter not working in TMPRO
1 parent e6bb06d commit 52ba6fa

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Assets/Scripts/Core/CaptureCamera.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public static void Capture(DisplayObject target, RenderTexture texture, float co
180180
if (target.graphics != null)
181181
{
182182
oldLayer = target.graphics.gameObject.layer;
183-
target.graphics.gameObject.layer = CaptureCamera.layer;
183+
target._SetLayerDirect(CaptureCamera.layer);
184184
}
185185

186186
if (target is Container)
@@ -196,7 +196,7 @@ public static void Capture(DisplayObject target, RenderTexture texture, float co
196196
RenderTexture.active = old;
197197

198198
if (target.graphics != null)
199-
target.graphics.gameObject.layer = oldLayer;
199+
target._SetLayerDirect(oldLayer);
200200

201201
if (target is Container)
202202
((Container)target).SetChildrenLayer(oldLayer);

Assets/Scripts/Core/NGraphics.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,12 @@ public VertexMatrix vertexMatrix
471471
{
472472
_vertexMatrix = value;
473473
_meshDirty = true;
474+
475+
if (subInstances != null)
476+
{
477+
foreach (var sub in subInstances)
478+
sub._vertexMatrix = value;
479+
}
474480
}
475481
}
476482

@@ -835,7 +841,10 @@ public NGraphics CreateSubInstance(string name)
835841
newGameObject.transform.SetParent(gameObject.transform, false);
836842
newGameObject.layer = gameObject.layer;
837843
newGameObject.hideFlags = gameObject.hideFlags;
838-
return new NGraphics(newGameObject);
844+
845+
var newGraphics = new NGraphics(newGameObject);
846+
newGraphics._vertexMatrix = _vertexMatrix;
847+
return newGraphics;
839848
}
840849

841850
class StencilEraser

0 commit comments

Comments
 (0)