internal void ScrollUp(int from, int to) { GLine top = FindLineOrEdge(from); GLine bottom = FindLineOrEdge(to); if (top == null || bottom == null) return; //エラーハンドリングはFindLineの中で。ここではクラッシュ回避だけを行う int bottom_id = bottom.ID; int topline_id = _topLine.ID; GLine nextbottom = bottom.NextLine; if (from == to) { _currentLine = top; _currentLine.Clear(); } else { Remove(bottom); _currentLine = new GLine(_width); InsertBefore(top, _currentLine); GLine c = _currentLine; do { c.ID = from++; c = c.NextLine; } while (c != nextbottom); Debug.Assert(nextbottom == null || nextbottom.ID == from); } /* //id maintainance GLine c = newbottom; GLine end = _currentLine.PrevLine; while(c != end) { c.ID = bottom_id--; c = c.PrevLine; } */ //!!次の2行はxtermをやっている間に発見して修正。 VT100では何かの必要があってこうなったはずなので後で調べること //if(_scrollingTop<=_topLine.ID && _topLine.ID<=_scrollingBottom) // _topLine = _currentLine; while (topline_id < _topLine.ID) _topLine = _topLine.PrevLine; _invalidatedRegion.InvalidatedAll = true; }
internal void ScrollDown(int from, int to) { GLine top = FindLineOrEdge(from); GLine bottom = FindLineOrEdge(to); int top_id = top.ID; GLine newtop = top.NextLine; if (from == to) { _currentLine = top; _currentLine.Clear(); } else { Remove(top); //_topLineの調整は必要ならここで行われる _currentLine = new GLine(_width); InsertAfter(bottom, _currentLine); //id maintainance GLine c = newtop; GLine end = _currentLine.NextLine; while (c != end) { c.ID = top_id++; c = c.NextLine; } } _invalidatedRegion.InvalidatedAll = true; }
internal void ScrollUp(int from, int to) { GLine top = FindLineOrEdge(from); GLine bottom = FindLineOrEdge(to); if (top == null || bottom == null) return; //�G���[�n���h�����O��FindLine�̒��ŁB�����ł̓N���b�V����������s�� int bottom_id = bottom.ID; int topline_id = _topLine.ID; GLine nextbottom = bottom.NextLine; if (from == to) { _currentLine = top; _currentLine.Clear(); } else { Remove(bottom); _currentLine = new GLine(_width); InsertBefore(top, _currentLine); GLine c = _currentLine; do { c.ID = from++; c = c.NextLine; } while (c != nextbottom); Debug.Assert(nextbottom == null || nextbottom.ID == from); } /* //id maintainance GLine c = newbottom; GLine end = _currentLine.PrevLine; while(c != end) { c.ID = bottom_id--; c = c.PrevLine; } */ //!!���̂Q�s��xterm�����Ă���Ԃɔ������ďC���B VT100�ł͉����̕K�v�������Ă����Ȃ����͂��Ȃ̂Ō�Œ��ׂ邱�� //if(_scrollingTop<=_topLine.ID && _topLine.ID<=_scrollingBottom) // _topLine = _currentLine; while (topline_id < _topLine.ID) _topLine = _topLine.PrevLine; _invalidatedRegion.InvalidatedAll = true; }