diff --git a/src/Artemis.Core/Models/Profile/Renderer.cs b/src/Artemis.Core/Models/Profile/Renderer.cs index 110974d05..7e502b277 100644 --- a/src/Artemis.Core/Models/Profile/Renderer.cs +++ b/src/Artemis.Core/Models/Profile/Renderer.cs @@ -7,6 +7,8 @@ namespace Artemis.Core { private bool _valid; private bool _disposed; + private SKRect _lastBounds; + private SKRect _lastParentBounds; public SKBitmap? Bitmap { get; private set; } public SKCanvas? Canvas { get; private set; } public SKPaint? Paint { get; private set; } @@ -26,6 +28,9 @@ namespace Artemis.Core if (IsOpen) throw new ArtemisCoreException("Cannot open render context because it is already open"); + if (path.Bounds != _lastBounds || (parent != null && parent.Bounds != _lastParentBounds)) + Invalidate(); + if (!_valid || Canvas == null) { SKRect pathBounds = path.Bounds; @@ -43,6 +48,8 @@ namespace Artemis.Core Canvas.ClipPath(Path); + _lastParentBounds = parent?.Bounds ?? new SKRect(); + _lastBounds = path.Bounds; _valid = true; } @@ -58,7 +65,7 @@ namespace Artemis.Core { if (_disposed) throw new ObjectDisposedException("Renderer"); - + Canvas?.Restore(); Paint?.Dispose(); Paint = null; diff --git a/src/Artemis.Core/Services/PluginManagementService.cs b/src/Artemis.Core/Services/PluginManagementService.cs index 633b6d45b..b67c27470 100644 --- a/src/Artemis.Core/Services/PluginManagementService.cs +++ b/src/Artemis.Core/Services/PluginManagementService.cs @@ -253,13 +253,13 @@ namespace Artemis.Core.Services PluginInfo pluginInfo = CoreJson.DeserializeObject(File.ReadAllText(metadataFile))!; if (pluginInfo.Guid == Constants.CorePluginInfo.Guid) - throw new ArtemisPluginException($"Plugin cannot use reserved GUID {pluginInfo.Guid}"); + throw new ArtemisPluginException($"Plugin {pluginInfo} cannot use reserved GUID {pluginInfo.Guid}"); lock (_plugins) { // Ensure the plugin is not already loaded if (_plugins.Any(p => p.Guid == pluginInfo.Guid)) - throw new ArtemisCoreException("Cannot load a plugin that is already loaded"); + throw new ArtemisCoreException($"Cannot load plugin {pluginInfo} because it is using a GUID already used by another plugin"); } // Load the entity and fall back on creating a new one