From 82386cae08129e1c44c993a4aeeb9c41c070d161 Mon Sep 17 00:00:00 2001 From: Savya Bikram Shah Date: Mon, 1 Jun 2026 14:09:51 +0545 Subject: [PATCH] fixes --- .../Capture/Systems/CaptureService.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Assets/Darkmatter/Code/Services/Capture/Systems/CaptureService.cs b/Assets/Darkmatter/Code/Services/Capture/Systems/CaptureService.cs index e6f2466..2ab5c07 100644 --- a/Assets/Darkmatter/Code/Services/Capture/Systems/CaptureService.cs +++ b/Assets/Darkmatter/Code/Services/Capture/Systems/CaptureService.cs @@ -48,7 +48,7 @@ namespace Darkmatter.Services.Capture disabledCanvases = DisableOtherRootCanvases(paperCanvas); disabledGraphics = HideNonPaperGraphics(paperRT); - HidePaperOwnGraphics(paperRT, disabledGraphics); + HideBackdropGraphics(paperRT, disabledGraphics); cam.clearFlags = CameraClearFlags.SolidColor; cam.backgroundColor = new Color(0f, 0f, 0f, 0f); @@ -158,16 +158,27 @@ namespace Darkmatter.Services.Capture return disabled; } - private static void HidePaperOwnGraphics(Transform paper, List disabled) + private static void HideBackdropGraphics(Transform paper, List disabled) { if (paper == null) return; - var graphics = paper.GetComponents(); - foreach (var g in graphics) + + // Paper root's own graphics (the paper panel itself). + foreach (var g in paper.GetComponents()) { if (g == null || !g.enabled) continue; g.enabled = false; disabled.Add(g); } + + // Solid-fill backdrops baked into the drawing: Images with no sprite render as a + // plain colored box. Colorable regions always carry a sprite (alpha hit-testing), + // so a null sprite means a backdrop, never art. + foreach (var img in paper.GetComponentsInChildren(includeInactive: false)) + { + if (img == null || !img.enabled || img.sprite != null) continue; + img.enabled = false; + disabled.Add(img); + } } private static Rect ComputeCropRect(GameObject target, int screenW, int screenH)