TODO feature: Copy-paste to a symbol with different size

This commit is contained in:
2025-05-18 00:50:05 +03:00
parent 0aeec8bd19
commit 2a940c8933
2 changed files with 18 additions and 11 deletions

View File

@@ -221,8 +221,6 @@ namespace McBitFont {
w = pixelOffset + dotWidth * (cellSize + gap); w = pixelOffset + dotWidth * (cellSize + gap);
h = pixelOffset + dotHeight * (cellSize + gap); h = pixelOffset + dotHeight * (cellSize + gap);
cbZoom_SelectedIndexChanged(cbZoom, null); cbZoom_SelectedIndexChanged(cbZoom, null);
fbuffer = false;
} }
private void cbZoom_SelectedIndexChanged(object sender, EventArgs e) { private void cbZoom_SelectedIndexChanged(object sender, EventArgs e) {
@@ -607,12 +605,7 @@ namespace McBitFont {
private void miniList_SelectedIndexChanged(object sender, EventArgs e) { private void miniList_SelectedIndexChanged(object sender, EventArgs e) {
if (miniList.FocusedItem == null) return; if (miniList.FocusedItem == null) return;
if (modified) { checkModifiedFrame();
if (MessageBox.Show("Current symbol is modified.\nDo you want to save the changes?", "Symbol was modified!", MessageBoxButtons.YesNo) == DialogResult.Yes) {
saveFrame();
}
modified = false;
}
if (miniList.SelectedItems.Count == 0) { if (miniList.SelectedItems.Count == 0) {
removeSymbolToolStripMenuItem.Enabled = false; removeSymbolToolStripMenuItem.Enabled = false;
copyToolStripMenuItem.Enabled = false; copyToolStripMenuItem.Enabled = false;
@@ -777,7 +770,19 @@ namespace McBitFont {
} }
private void pasteToolStripMenuItem_Click(object sender, EventArgs e) { private void pasteToolStripMenuItem_Click(object sender, EventArgs e) {
Array.Copy(fbuf.data, f.data, fbuf.data.Length); if (fbuf.width == f.width && fbuf.height == f.height) {
Array.Copy(fbuf.data, f.data, fbuf.data.Length);
} else {
var wmax = (fbuf.width > f.width) ? f.width : fbuf.width;
var hmax = (fbuf.height > f.height) ? f.height : fbuf.height;
for (int i = 0; i < wmax; i++) {
for (int j = 0; j < hmax; j++) {
f.data[i,j] = fbuf.data[i,j];
}
}
}
dotPanel.Refresh(); dotPanel.Refresh();
modified = true; modified = true;
} }
@@ -794,9 +799,10 @@ namespace McBitFont {
// Check modified / Save frame // Check modified / Save frame
private void checkModifiedFrame() { private void checkModifiedFrame() {
if (modified) { if (modified) {
if (MessageBox.Show("Current frame is modified.\nDo you want to apply the changes first?", "The frame was modified!", MessageBoxButtons.YesNo) == DialogResult.Yes) { if (MessageBox.Show("Current symbol is modified.\nDo you want to save the changes?", "Symbol was modified!", MessageBoxButtons.YesNo) == DialogResult.Yes) {
saveFrame(); saveFrame();
} }
modified = false;
} }
} }

View File

@@ -14,11 +14,12 @@ V "Single frame", "only numbers" and "specify range" as radio buttons
- Undo/Redo - Undo/Redo
- Image import from a file - Image import from a file
- Import from a text array - Import from a text array
- Copy-paste to a symbol with different size V Copy-paste to a symbol with different size
- Rectangle selection to mass-paint, shift and mirror pixels - Rectangle selection to mass-paint, shift and mirror pixels
- Change height of variable width fonts with ability to choose which side to add pixels to - Change height of variable width fonts with ability to choose which side to add pixels to
V Make it possible to have zero width chars in VarWidth fonts V Make it possible to have zero width chars in VarWidth fonts
- "Packed" fonts export - "Packed" fonts export
- Tooltips on main form
Bugs: Bugs:
V Every char changes its width to default on VarWidth font height change! V Every char changes its width to default on VarWidth font height change!