Slight folder performance tweak

This commit is contained in:
SpoinkyNL committed 2020-06-18 17:52:26 +02:00
1 parent 18c1b533b9
commit 738c090833
1 file changed
+2 -5
+2 -5
View File
@@ -78,12 +78,9 @@ namespace Artemis.Core.Models.Profile
public override void Render(double deltaTime, SKCanvas canvas, SKImageInfo canvasInfo) public override void Render(double deltaTime, SKCanvas canvas, SKImageInfo canvasInfo)
{ {
if (!Enabled) if (!Enabled || Path == null || !Children.Any(c => c.Enabled))
return; return;
if (Path == null)
return;
if (_folderBitmap == null) if (_folderBitmap == null)
_folderBitmap = new SKBitmap(new SKImageInfo((int) Path.Bounds.Width, (int) Path.Bounds.Height)); _folderBitmap = new SKBitmap(new SKImageInfo((int) Path.Bounds.Width, (int) Path.Bounds.Height));
else if (_folderBitmap.Info.Width != (int) Path.Bounds.Width || _folderBitmap.Info.Height != (int) Path.Bounds.Height) else if (_folderBitmap.Info.Width != (int) Path.Bounds.Width || _folderBitmap.Info.Height != (int) Path.Bounds.Height)