mirror of https://github.com/odrling/Aegisub
Only scroll the grid to the active line if the row has actually changed
Makes it so that undo/redo only scrolls to the active line if it's different in the two versions of the file.
This commit is contained in:
parent
f24a72d8fc
commit
2508dd9c6e
|
@ -237,11 +237,13 @@ void BaseGrid::UpdateMaps() {
|
|||
|
||||
void BaseGrid::OnActiveLineChanged(AssDialogue *new_active) {
|
||||
if (new_active) {
|
||||
int row = new_active->Row;
|
||||
MakeRowVisible(row);
|
||||
extendRow = row;
|
||||
if (new_active->Row != active_row)
|
||||
MakeRowVisible(new_active->Row);
|
||||
extendRow = active_row = new_active->Row;
|
||||
Refresh(false);
|
||||
}
|
||||
else
|
||||
active_row = -1;
|
||||
}
|
||||
|
||||
void BaseGrid::MakeRowVisible(int row) {
|
||||
|
|
|
@ -55,6 +55,8 @@ class BaseGrid final : public wxWindow {
|
|||
/// First row that is visible at the current scroll position
|
||||
int yPos = 0;
|
||||
|
||||
int active_row = -1;
|
||||
|
||||
agi::Context *context; ///< Associated project context
|
||||
|
||||
std::vector<std::unique_ptr<GridColumn>> columns;
|
||||
|
|
Loading…
Reference in New Issue