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) {
|
void BaseGrid::OnActiveLineChanged(AssDialogue *new_active) {
|
||||||
if (new_active) {
|
if (new_active) {
|
||||||
int row = new_active->Row;
|
if (new_active->Row != active_row)
|
||||||
MakeRowVisible(row);
|
MakeRowVisible(new_active->Row);
|
||||||
extendRow = row;
|
extendRow = active_row = new_active->Row;
|
||||||
Refresh(false);
|
Refresh(false);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
active_row = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseGrid::MakeRowVisible(int row) {
|
void BaseGrid::MakeRowVisible(int row) {
|
||||||
|
|
|
@ -55,6 +55,8 @@ class BaseGrid final : public wxWindow {
|
||||||
/// First row that is visible at the current scroll position
|
/// First row that is visible at the current scroll position
|
||||||
int yPos = 0;
|
int yPos = 0;
|
||||||
|
|
||||||
|
int active_row = -1;
|
||||||
|
|
||||||
agi::Context *context; ///< Associated project context
|
agi::Context *context; ///< Associated project context
|
||||||
|
|
||||||
std::vector<std::unique_ptr<GridColumn>> columns;
|
std::vector<std::unique_ptr<GridColumn>> columns;
|
||||||
|
|
Loading…
Reference in New Issue