зеркало из https://github.com/xamarin/XtermSharp.git
Merge pull request #2 from xamarin/dev/nosami/remove-system-drawing
Use custom Point struct to remove System.Drawing
This commit is contained in:
Коммит
bd987e1d59
|
@ -410,7 +410,7 @@ namespace XtermSharp.Mac {
|
|||
|
||||
void UpdateCursorPosition ()
|
||||
{
|
||||
caret.Pos = new System.Drawing.Point (terminal.Buffer.X, terminal.Buffer.Y - terminal.Buffer.YDisp + terminal.Buffer.YBase);
|
||||
caret.Pos = new Point (terminal.Buffer.X, terminal.Buffer.Y - terminal.Buffer.YDisp + terminal.Buffer.YBase);
|
||||
}
|
||||
|
||||
void UpdateDisplay ()
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
namespace XtermSharp
|
||||
{
|
||||
public struct Point
|
||||
{
|
||||
public static readonly Point Empty;
|
||||
|
||||
public Point(int x, int y)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
}
|
||||
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
|
||||
public bool IsEmpty => X == 0 && Y == 0;
|
||||
|
||||
public static bool operator ==(Point left, Point right) => left.X == right.X && left.Y == right.Y;
|
||||
|
||||
public static bool operator !=(Point left, Point right) => !(left == right);
|
||||
|
||||
public override bool Equals(object obj) => obj is Point point && point.X == X && point.Y == Y;
|
||||
|
||||
public override int GetHashCode() => X.GetHashCode() * 327 + Y.GetHashCode();
|
||||
|
||||
public override string ToString() => "{X=" + X.ToString() + ",Y=" + Y.ToString() + "}";
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
|
||||
namespace XtermSharp {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
|
||||
namespace XtermSharp {
|
||||
|
|
Загрузка…
Ссылка в новой задаче