Version changed to 2.5; TODO feature: Straight line painting (hold Shift / Ctrl)

This commit is contained in:
Anton Mukhin
2025-06-03 11:30:12 +03:00
parent 76ca7ccf35
commit 9cfe8ef5c3
3 changed files with 18 additions and 8 deletions

View File

@@ -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;

View File

@@ -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'">

View File

@@ -4,7 +4,7 @@ Application:
Functionality:
V Middle mouse - drag the canvas
- Straight line painting
V Straight line painting (hold Shift / Ctrl)
V A button to Copy from Test font dialog to then paste into another frame
Bugs: