|
@@ -11,6 +11,7 @@ using PixiEditor.Models.DocumentModels;
|
|
using Drawie.Numerics;
|
|
using Drawie.Numerics;
|
|
using PixiEditor.Extensions.CommonApi.UserPreferences.Settings;
|
|
using PixiEditor.Extensions.CommonApi.UserPreferences.Settings;
|
|
using PixiEditor.Extensions.CommonApi.UserPreferences.Settings.PixiEditor;
|
|
using PixiEditor.Extensions.CommonApi.UserPreferences.Settings.PixiEditor;
|
|
|
|
+using PixiEditor.Models.Commands.Attributes.Commands;
|
|
using PixiEditor.Models.Handlers;
|
|
using PixiEditor.Models.Handlers;
|
|
using PixiEditor.ViewModels.Dock;
|
|
using PixiEditor.ViewModels.Dock;
|
|
using PixiEditor.ViewModels.Document;
|
|
using PixiEditor.ViewModels.Document;
|
|
@@ -98,6 +99,7 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
|
|
}
|
|
}
|
|
|
|
|
|
private bool autoScaleBackground = true;
|
|
private bool autoScaleBackground = true;
|
|
|
|
+
|
|
public bool AutoScaleBackground
|
|
public bool AutoScaleBackground
|
|
{
|
|
{
|
|
get => autoScaleBackground;
|
|
get => autoScaleBackground;
|
|
@@ -109,6 +111,7 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
|
|
}
|
|
}
|
|
|
|
|
|
private double customBackgroundScaleX = 16;
|
|
private double customBackgroundScaleX = 16;
|
|
|
|
+
|
|
public double CustomBackgroundScaleX
|
|
public double CustomBackgroundScaleX
|
|
{
|
|
{
|
|
get => customBackgroundScaleX;
|
|
get => customBackgroundScaleX;
|
|
@@ -120,6 +123,7 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
|
|
}
|
|
}
|
|
|
|
|
|
private double customBackgroundScaleY = 16;
|
|
private double customBackgroundScaleY = 16;
|
|
|
|
+
|
|
public double CustomBackgroundScaleY
|
|
public double CustomBackgroundScaleY
|
|
{
|
|
{
|
|
get => customBackgroundScaleY;
|
|
get => customBackgroundScaleY;
|
|
@@ -131,6 +135,7 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
|
|
}
|
|
}
|
|
|
|
|
|
private Bitmap backgroundBitmap;
|
|
private Bitmap backgroundBitmap;
|
|
|
|
+
|
|
public Bitmap BackgroundBitmap
|
|
public Bitmap BackgroundBitmap
|
|
{
|
|
{
|
|
get => backgroundBitmap;
|
|
get => backgroundBitmap;
|
|
@@ -175,6 +180,7 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
|
|
TabCustomizationSettings.Icon = previewPainterControl;
|
|
TabCustomizationSettings.Icon = previewPainterControl;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
private void DocumentOnPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
|
private void DocumentOnPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
|
{
|
|
{
|
|
if (e.PropertyName == nameof(DocumentViewModel.FileName))
|
|
if (e.PropertyName == nameof(DocumentViewModel.FileName))
|
|
@@ -245,6 +251,11 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
|
|
CustomBackgroundScaleY = newValue;
|
|
CustomBackgroundScaleY = newValue;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public VecI GetRenderOutputSize()
|
|
|
|
+ {
|
|
|
|
+ return Document.GetRenderOutputSize(RenderOutputName);
|
|
|
|
+ }
|
|
|
|
+
|
|
private void UpdateBackgroundBitmap(Setting<string> setting, string newValue)
|
|
private void UpdateBackgroundBitmap(Setting<string> setting, string newValue)
|
|
{
|
|
{
|
|
BackgroundBitmap?.Dispose();
|
|
BackgroundBitmap?.Dispose();
|
|
@@ -260,11 +271,7 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
|
|
|
|
|
|
Surface surface = Surface.ForDisplay(new VecI(2, 2));
|
|
Surface surface = Surface.ForDisplay(new VecI(2, 2));
|
|
surface.DrawingSurface.Canvas.Clear(primary);
|
|
surface.DrawingSurface.Canvas.Clear(primary);
|
|
- using Paint secondaryPaint = new Paint
|
|
|
|
- {
|
|
|
|
- Color = secondary,
|
|
|
|
- Style = PaintStyle.Fill
|
|
|
|
- };
|
|
|
|
|
|
+ using Paint secondaryPaint = new Paint { Color = secondary, Style = PaintStyle.Fill };
|
|
surface.DrawingSurface.Canvas.DrawRect(1, 0, 1, 1, secondaryPaint);
|
|
surface.DrawingSurface.Canvas.DrawRect(1, 0, 1, 1, secondaryPaint);
|
|
surface.DrawingSurface.Canvas.DrawRect(0, 1, 1, 1, secondaryPaint);
|
|
surface.DrawingSurface.Canvas.DrawRect(0, 1, 1, 1, secondaryPaint);
|
|
|
|
|
|
@@ -297,5 +304,4 @@ internal class ViewportWindowViewModel : SubViewModel<WindowViewModel>, IDockabl
|
|
{
|
|
{
|
|
Owner.Owner.ShortcutController.ClearContext(GetType());
|
|
Owner.Owner.ShortcutController.ClearContext(GetType());
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|