xw-devtool-cli 1.0.33 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -25,6 +25,7 @@ public class DistanceForm : Form {
|
|
|
25
25
|
private bool p1Set = false;
|
|
26
26
|
private bool p2Set = false;
|
|
27
27
|
private Bitmap screenCapture;
|
|
28
|
+
private Timer t;
|
|
28
29
|
|
|
29
30
|
public DistanceForm() {
|
|
30
31
|
this.FormBorderStyle = FormBorderStyle.None;
|
|
@@ -47,6 +48,11 @@ public class DistanceForm : Form {
|
|
|
47
48
|
g.CopyFromScreen(totalBounds.Location, Point.Empty, totalBounds.Size);
|
|
48
49
|
}
|
|
49
50
|
this.BackgroundImage = screenCapture;
|
|
51
|
+
|
|
52
|
+
t = new Timer();
|
|
53
|
+
t.Interval = 33;
|
|
54
|
+
t.Tick += (s, e) => { this.Invalidate(); };
|
|
55
|
+
t.Start();
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
private Point GetSnappedPoint(Point current) {
|
|
@@ -95,9 +101,7 @@ public class DistanceForm : Form {
|
|
|
95
101
|
}
|
|
96
102
|
|
|
97
103
|
protected override void OnMouseMove(MouseEventArgs e) {
|
|
98
|
-
|
|
99
|
-
this.Invalidate();
|
|
100
|
-
}
|
|
104
|
+
this.Invalidate();
|
|
101
105
|
}
|
|
102
106
|
|
|
103
107
|
protected override void OnPaint(PaintEventArgs e) {
|
|
@@ -105,10 +109,18 @@ public class DistanceForm : Form {
|
|
|
105
109
|
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
|
|
106
110
|
|
|
107
111
|
Pen pen = new Pen(Color.Red, 2);
|
|
112
|
+
Pen crossPen = new Pen(Color.Red, 1);
|
|
108
113
|
Brush brush = Brushes.Red;
|
|
109
114
|
Font font = new Font("Segoe UI", 12, FontStyle.Bold);
|
|
110
115
|
Brush textBg = new SolidBrush(Color.FromArgb(180, 0, 0, 0));
|
|
111
116
|
|
|
117
|
+
Point cp = this.PointToClient(Cursor.Position);
|
|
118
|
+
int gap = 24;
|
|
119
|
+
g.DrawLine(crossPen, 0, cp.Y, Math.Max(0, cp.X - gap), cp.Y);
|
|
120
|
+
g.DrawLine(crossPen, Math.Min(this.ClientSize.Width, cp.X + gap), cp.Y, this.ClientSize.Width, cp.Y);
|
|
121
|
+
g.DrawLine(crossPen, cp.X, 0, cp.X, Math.Max(0, cp.Y - gap));
|
|
122
|
+
g.DrawLine(crossPen, cp.X, Math.Min(this.ClientSize.Height, cp.Y + gap), cp.X, this.ClientSize.Height);
|
|
123
|
+
|
|
112
124
|
if (p1Set) {
|
|
113
125
|
Point target = p2Set ? p2 : GetSnappedPoint(this.PointToClient(Cursor.Position));
|
|
114
126
|
|