Permalink
Browse files

Add copy-paste to the font editor

  • Loading branch information...
mniip committed May 8, 2018
1 parent 954086f commit ea1d574caf3c9e454489ca68e3b3bd33df144087
Showing with 12 additions and 1 deletion.
  1. +9 −1 src/gui/font/FontEditor.cpp
  2. +3 −0 src/gui/font/FontEditor.h
@@ -293,7 +293,7 @@ FontEditor::FontEditor(ByteString _header):
CharNumberAction(FontEditor *_v): v(_v) {}
void TextChangedCallback(ui::Textbox *)
{
unsigned int number = v->currentCharTextbox->GetText().ToNumber<unsigned int>(true);
unsigned int number = v->currentCharTextbox->GetText().ToNumber<unsigned int>(Format::Hex(), true);
if(number <= 0x10FFFF)
v->currentChar = number;
}
@@ -600,6 +600,14 @@ void FontEditor::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bo
else
ui::Engine::Ref().ConfirmExit();
break;
case 'c':
clipboardWidth = fontWidths[currentChar];
clipboardPixels = fontPixels[currentChar];
break;
case 'v':
fontWidths[currentChar] = clipboardWidth;
fontPixels[currentChar] = clipboardPixels;
break;
}
}
}
@@ -53,6 +53,9 @@ class FontEditor: public ui::Window
int grid;
int rulers;
unsigned char clipboardWidth;
std::array<std::array<char, MAX_WIDTH>, FONT_H> clipboardPixels;
void UpdateCharNumber();
void PrevChar();
void NextChar();

0 comments on commit ea1d574

Please sign in to comment.