Skip to content

Commit

Permalink
Merge pull request #1164 from VladiStep/fixExportAllRoomsScript
Browse files Browse the repository at this point in the history
Fix of "ExportAllRoomsToPng.csx" script.
  • Loading branch information
Grossley authored Feb 2, 2023
2 parents 20603f3 + 80887da commit 6b92fb8
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions UndertaleModTool/Controls/UndertaleRoomRenderer.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ public UndertalePath PreviewPath
}

private bool bgGridDisabled;
private Pen gridPen;
private Brush initialGridBrush;
private Brush gridOpacMask;

public UndertaleRoomRenderer()
{
Expand Down Expand Up @@ -85,13 +84,10 @@ public void SaveImagePNG(Stream outfile, bool displayGrid = false, bool last = f

if (!displayGrid && !bgGridDisabled)
{
if (gridPen is null)
{
gridPen = ((roomCanvas.Background as DrawingBrush).Drawing as GeometryDrawing).Pen;
initialGridBrush = gridPen.Brush;
}
if (gridOpacMask is null)
gridOpacMask = roomCanvas.OpacityMask;

gridPen.Brush = null;
roomCanvas.OpacityMask = null;
bgGridDisabled = true;
}

Expand All @@ -106,7 +102,7 @@ public void SaveImagePNG(Stream outfile, bool displayGrid = false, bool last = f
if (!displayGrid && last)
{
visualOffProp.SetValue(roomCanvas, prevOffset);
gridPen.Brush = initialGridBrush;
roomCanvas.OpacityMask = gridOpacMask;
}
}));
}
Expand Down

0 comments on commit 6b92fb8

Please sign in to comment.