Version changed to 2.5; TODO feature: Straight line painting (hold Shift / Ctrl)
This commit is contained in:
@@ -416,10 +416,11 @@ namespace McBitFont {
|
||||
dotPanel.Refresh();
|
||||
}
|
||||
|
||||
private bool mouseDown = false;
|
||||
private bool fChanged = false;
|
||||
private bool mouseDownMiddle = false;
|
||||
private int mouseX, mouseY;
|
||||
private bool mouseDown = false; // Used in canvas history tracking and rectangle selection logics
|
||||
private bool fChanged = false; // Used in canvas history (undo / redo) tracking
|
||||
private bool mouseDownMiddle = false; // Used in middle mouse dragging logic
|
||||
private int mouseX, mouseY; // To remember last mouse X and Y (used in middle mouse dragging logic)
|
||||
private int lastX = 0, lastY = 0; // Used for drawing straight lines
|
||||
private void dotPanel_MouseMove(object sender, MouseEventArgs e) {
|
||||
var rectSel = chkRectSelect.Checked;
|
||||
bool rectSelUpdated = false;
|
||||
@@ -551,6 +552,15 @@ namespace McBitFont {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for Shift / Ctrl keys for straight lines
|
||||
if (ModifierKeys.HasFlag(Keys.Shift)) {
|
||||
j = lastY;
|
||||
} else if (ModifierKeys.HasFlag(Keys.Control)) {
|
||||
i = lastX;
|
||||
}
|
||||
lastX = i;
|
||||
lastY = j;
|
||||
|
||||
// Paint black / white
|
||||
if (e.Button == MouseButtons.Left && !f.data[i, j]) {
|
||||
f.data[i, j] = true;
|
||||
|
@@ -20,9 +20,9 @@
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||
<ApplicationIcon>icon_64.ico</ApplicationIcon>
|
||||
<AssemblyVersion>2.4.0.0</AssemblyVersion>
|
||||
<FileVersion>2.4.0.0</FileVersion>
|
||||
<Version>$(VersionPrefix)2.4.0</Version>
|
||||
<AssemblyVersion>2.5.0.0</AssemblyVersion>
|
||||
<FileVersion>2.5.0.0</FileVersion>
|
||||
<Version>$(VersionPrefix)2.5.0</Version>
|
||||
<Copyright>Anton Mukhin</Copyright>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
Reference in New Issue
Block a user