TODO feature: Middle mouse - drag the canvas
This commit is contained in:
26
McBitFont/FontTester.Designer.cs
generated
26
McBitFont/FontTester.Designer.cs
generated
@@ -34,8 +34,8 @@
|
|||||||
lblZoom = new System.Windows.Forms.Label();
|
lblZoom = new System.Windows.Forms.Label();
|
||||||
cbZoom = new System.Windows.Forms.ComboBox();
|
cbZoom = new System.Windows.Forms.ComboBox();
|
||||||
toolTip1 = new System.Windows.Forms.ToolTip(components);
|
toolTip1 = new System.Windows.Forms.ToolTip(components);
|
||||||
chkBaseline = new System.Windows.Forms.CheckBox();
|
|
||||||
btnCopy = new System.Windows.Forms.Button();
|
btnCopy = new System.Windows.Forms.Button();
|
||||||
|
chkBaseline = new System.Windows.Forms.CheckBox();
|
||||||
((System.ComponentModel.ISupportInitialize)nudSpace).BeginInit();
|
((System.ComponentModel.ISupportInitialize)nudSpace).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
vScroll.LargeChange = 25;
|
vScroll.LargeChange = 25;
|
||||||
vScroll.Location = new System.Drawing.Point(251, 84);
|
vScroll.Location = new System.Drawing.Point(251, 84);
|
||||||
vScroll.Name = "vScroll";
|
vScroll.Name = "vScroll";
|
||||||
vScroll.Size = new System.Drawing.Size(21, 125);
|
vScroll.Size = new System.Drawing.Size(21, 104);
|
||||||
vScroll.TabIndex = 17;
|
vScroll.TabIndex = 17;
|
||||||
vScroll.ValueChanged += Scrolling;
|
vScroll.ValueChanged += Scrolling;
|
||||||
//
|
//
|
||||||
@@ -141,17 +141,6 @@
|
|||||||
toolTip1.InitialDelay = 500;
|
toolTip1.InitialDelay = 500;
|
||||||
toolTip1.ReshowDelay = 100;
|
toolTip1.ReshowDelay = 100;
|
||||||
//
|
//
|
||||||
// chkBaseline
|
|
||||||
//
|
|
||||||
chkBaseline.AutoSize = true;
|
|
||||||
chkBaseline.Location = new System.Drawing.Point(203, 36);
|
|
||||||
chkBaseline.Name = "chkBaseline";
|
|
||||||
chkBaseline.Size = new System.Drawing.Size(69, 19);
|
|
||||||
chkBaseline.TabIndex = 20;
|
|
||||||
chkBaseline.Text = "Baseline";
|
|
||||||
chkBaseline.UseVisualStyleBackColor = true;
|
|
||||||
chkBaseline.CheckedChanged += Scrolling;
|
|
||||||
//
|
|
||||||
// btnCopy
|
// btnCopy
|
||||||
//
|
//
|
||||||
btnCopy.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
btnCopy.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||||
@@ -167,6 +156,17 @@
|
|||||||
btnCopy.UseVisualStyleBackColor = true;
|
btnCopy.UseVisualStyleBackColor = true;
|
||||||
btnCopy.MouseClick += Copy_Click;
|
btnCopy.MouseClick += Copy_Click;
|
||||||
//
|
//
|
||||||
|
// chkBaseline
|
||||||
|
//
|
||||||
|
chkBaseline.AutoSize = true;
|
||||||
|
chkBaseline.Location = new System.Drawing.Point(203, 36);
|
||||||
|
chkBaseline.Name = "chkBaseline";
|
||||||
|
chkBaseline.Size = new System.Drawing.Size(69, 19);
|
||||||
|
chkBaseline.TabIndex = 20;
|
||||||
|
chkBaseline.Text = "Baseline";
|
||||||
|
chkBaseline.UseVisualStyleBackColor = true;
|
||||||
|
chkBaseline.CheckedChanged += Scrolling;
|
||||||
|
//
|
||||||
// FontTester
|
// FontTester
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||||
|
7
McBitFont/Form1.Designer.cs
generated
7
McBitFont/Form1.Designer.cs
generated
@@ -493,7 +493,10 @@
|
|||||||
// hScroll
|
// hScroll
|
||||||
//
|
//
|
||||||
hScroll.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
hScroll.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||||
|
hScroll.Enabled = false;
|
||||||
|
hScroll.LargeChange = 2;
|
||||||
hScroll.Location = new System.Drawing.Point(14, 609);
|
hScroll.Location = new System.Drawing.Point(14, 609);
|
||||||
|
hScroll.Maximum = 1;
|
||||||
hScroll.Name = "hScroll";
|
hScroll.Name = "hScroll";
|
||||||
hScroll.Size = new System.Drawing.Size(427, 21);
|
hScroll.Size = new System.Drawing.Size(427, 21);
|
||||||
hScroll.TabIndex = 14;
|
hScroll.TabIndex = 14;
|
||||||
@@ -502,8 +505,10 @@
|
|||||||
// vScroll
|
// vScroll
|
||||||
//
|
//
|
||||||
vScroll.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
|
vScroll.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
|
||||||
vScroll.LargeChange = 25;
|
vScroll.Enabled = false;
|
||||||
|
vScroll.LargeChange = 2;
|
||||||
vScroll.Location = new System.Drawing.Point(444, 31);
|
vScroll.Location = new System.Drawing.Point(444, 31);
|
||||||
|
vScroll.Maximum = 1;
|
||||||
vScroll.Name = "vScroll";
|
vScroll.Name = "vScroll";
|
||||||
vScroll.Size = new System.Drawing.Size(21, 575);
|
vScroll.Size = new System.Drawing.Size(21, 575);
|
||||||
vScroll.TabIndex = 15;
|
vScroll.TabIndex = 15;
|
||||||
|
@@ -296,6 +296,7 @@ namespace McBitFont {
|
|||||||
if (w <= dotPanel.Width) {
|
if (w <= dotPanel.Width) {
|
||||||
hScroll.Enabled = false;
|
hScroll.Enabled = false;
|
||||||
hScroll.Value = 0;
|
hScroll.Value = 0;
|
||||||
|
vScroll.Maximum = 0;
|
||||||
} else {
|
} else {
|
||||||
hScroll.Maximum = w - dotPanel.Width + 12;
|
hScroll.Maximum = w - dotPanel.Width + 12;
|
||||||
hScroll.Minimum = 0;
|
hScroll.Minimum = 0;
|
||||||
@@ -305,6 +306,7 @@ namespace McBitFont {
|
|||||||
if (h <= dotPanel.Height) {
|
if (h <= dotPanel.Height) {
|
||||||
vScroll.Enabled = false;
|
vScroll.Enabled = false;
|
||||||
vScroll.Value = 0;
|
vScroll.Value = 0;
|
||||||
|
vScroll.Maximum = 0;
|
||||||
} else {
|
} else {
|
||||||
vScroll.Maximum = h - dotPanel.Height + 12;
|
vScroll.Maximum = h - dotPanel.Height + 12;
|
||||||
vScroll.Minimum = 0;
|
vScroll.Minimum = 0;
|
||||||
@@ -416,10 +418,45 @@ namespace McBitFont {
|
|||||||
|
|
||||||
private bool mouseDown = false;
|
private bool mouseDown = false;
|
||||||
private bool fChanged = false;
|
private bool fChanged = false;
|
||||||
|
private bool mouseDownMiddle = false;
|
||||||
|
private int mouseX, mouseY;
|
||||||
private void dotPanel_MouseMove(object sender, MouseEventArgs e) {
|
private void dotPanel_MouseMove(object sender, MouseEventArgs e) {
|
||||||
var rectSel = chkRectSelect.Checked;
|
var rectSel = chkRectSelect.Checked;
|
||||||
bool rectSelUpdated = false;
|
bool rectSelUpdated = false;
|
||||||
|
|
||||||
|
// Drag with middle mouse button
|
||||||
|
if (vScroll.Enabled || hScroll.Enabled) {
|
||||||
|
if (mouseDownMiddle) {
|
||||||
|
var dY = mouseY - e.Y <= -cellSize - gap || mouseY - e.Y >= cellSize + gap;
|
||||||
|
var dX = mouseX - e.X <= -cellSize - gap || mouseX - e.X >= cellSize + gap;
|
||||||
|
int newY = vScroll.Value;
|
||||||
|
int newX = hScroll.Value;
|
||||||
|
if (dX) {
|
||||||
|
newX += (mouseX - e.X);
|
||||||
|
if (newX < hScroll.Minimum) newX = hScroll.Minimum;
|
||||||
|
if (newX > hScroll.Maximum) newX = hScroll.Maximum;
|
||||||
|
mouseX = e.X;
|
||||||
|
hScroll.Value = newX;
|
||||||
|
}
|
||||||
|
if (dY) {
|
||||||
|
newY += (mouseY - e.Y);
|
||||||
|
if (newY < vScroll.Minimum) newY = vScroll.Minimum;
|
||||||
|
if (newY > vScroll.Maximum) newY = vScroll.Maximum;
|
||||||
|
mouseY = e.Y;
|
||||||
|
vScroll.Value = newY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!mouseDownMiddle && e.Button == MouseButtons.Middle) {
|
||||||
|
mouseDownMiddle = true;
|
||||||
|
mouseX = e.X;
|
||||||
|
mouseY = e.Y;
|
||||||
|
}
|
||||||
|
if (mouseDownMiddle && e.Button == MouseButtons.None) {
|
||||||
|
mouseDownMiddle = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Moving baseline
|
// Moving baseline
|
||||||
Rectangle rect1, rect2;
|
Rectangle rect1, rect2;
|
||||||
if (set_base) {
|
if (set_base) {
|
||||||
|
2
TODO.txt
2
TODO.txt
@@ -3,7 +3,7 @@ Application:
|
|||||||
|
|
||||||
|
|
||||||
Functionality:
|
Functionality:
|
||||||
- Middle mouse - drag the canvas
|
V Middle mouse - drag the canvas
|
||||||
- Straight line painting
|
- Straight line painting
|
||||||
V A button to Copy from Test font dialog to then paste into another frame
|
V A button to Copy from Test font dialog to then paste into another frame
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user