mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-24 06:44:25 -04:00
Random data selection feature done. (#1617)
This commit is contained in:
parent
b7b4a10485
commit
7354ba8fd5
4 changed files with 87 additions and 47 deletions
|
@ -153,12 +153,12 @@ void TextViewer::cursor_set(uint16_t line, uint16_t col) {
|
|||
|
||||
void TextViewer::cursor_mark_selected() {
|
||||
LineColPair newMarker = std::make_pair(cursor_.line, cursor_.col);
|
||||
auto it = std::find(pairedVector.begin(), pairedVector.end(), newMarker);
|
||||
auto it = std::find(lineColPair.begin(), lineColPair.end(), newMarker);
|
||||
|
||||
if (it != pairedVector.end()) {
|
||||
pairedVector.erase(it);
|
||||
if (it != lineColPair.end()) {
|
||||
lineColPair.erase(it);
|
||||
} else {
|
||||
pairedVector.push_back(newMarker);
|
||||
lineColPair.push_back(newMarker);
|
||||
}
|
||||
|
||||
// Mark pending change.
|
||||
|
@ -167,6 +167,11 @@ void TextViewer::cursor_mark_selected() {
|
|||
redraw();
|
||||
}
|
||||
|
||||
void TextViewer::cursor_clear_marked() {
|
||||
lineColPair.clear();
|
||||
redraw(true, true);
|
||||
}
|
||||
|
||||
uint16_t TextViewer::line_length() {
|
||||
return file_->line_length(cursor_.line);
|
||||
}
|
||||
|
@ -313,9 +318,9 @@ void TextViewer::paint_marked(Painter& painter) {
|
|||
}
|
||||
};
|
||||
|
||||
auto it = pairedVector.begin();
|
||||
auto it = lineColPair.begin();
|
||||
|
||||
while (it != pairedVector.end()) {
|
||||
while (it != lineColPair.end()) {
|
||||
LineColPair entry = (LineColPair)*it;
|
||||
xor_cursor(entry.first, entry.second);
|
||||
it++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue