Skip to content

Commit

Permalink
EditorCanvasView is the camera class
Browse files Browse the repository at this point in the history
  • Loading branch information
iconstudio committed Oct 7, 2023
1 parent 363aaee commit e5610a4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
35 changes: 34 additions & 1 deletion Editor/TestEditor/Editor/EditorCanvasView.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,39 @@
namespace TestEditor.Editor
using Windows.Foundation;

namespace TestEditor.Editor
{
internal class EditorCanvasView
{
private Rect myRect;

public Rect Region
{
get => myRect;
set => myRect = value;
}
public double X
{
get => myRect.X;
set => myRect.X = value;
}
public double Y
{
get => myRect.Y;
set => myRect.Y = value;
}
public double W
{
get => myRect.Width;
set => myRect.Width = value;
}
public double H
{
get => myRect.Height;
set => myRect.Height = value;
}
public double Left => myRect.Left;
public double Right => myRect.Right;
public double Top => myRect.Top;
public double Bottom => myRect.Bottom;
}
}
4 changes: 4 additions & 0 deletions Editor/TestEditor/Infrastructures/EditorCanvas.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public sealed partial class EditorCanvas : UserControl
private bool isDragging;
private PointerRoutedEventArgs lastDragArgs;

private EditorCanvasView Camera { get; }

private class NullEditorPageException : NullReferenceException
{
public NullEditorPageException(string message) : base(message)
Expand All @@ -37,6 +39,8 @@ public EditorCanvas()
InitializeComponent();

Draw += Render;

Camera = new();
}

public void Clear()
Expand Down

0 comments on commit e5610a4

Please sign in to comment.