… | |
… | |
5 | * Copyright (c) 1997-2001 Geoff Wing <gcw@pobox.com> |
5 | * Copyright (c) 1997-2001 Geoff Wing <gcw@pobox.com> |
6 | * Copyright (c) 2003-2007 Marc Lehmann <schmorp@schmorp.de> |
6 | * Copyright (c) 2003-2007 Marc Lehmann <schmorp@schmorp.de> |
7 | * |
7 | * |
8 | * This program is free software; you can redistribute it and/or modify |
8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by |
9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or |
10 | * the Free Software Foundation; either version 3 of the License, or |
11 | * (at your option) any later version. |
11 | * (at your option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, |
13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
… | |
… | |
1897 | * the top of the screen |
1897 | * the top of the screen |
1898 | */ |
1898 | */ |
1899 | void |
1899 | void |
1900 | rxvt_term::scr_move_to (int y, int len) NOTHROW |
1900 | rxvt_term::scr_move_to (int y, int len) NOTHROW |
1901 | { |
1901 | { |
1902 | scr_changeview ((top_row - nrow) * (len - y) / len + (nrow - 1)); |
1902 | // lerp (y, 0, len, top_row, nrow - 1) |
|
|
1903 | scr_changeview (top_row + (nrow - 1 - top_row) * y / len); |
1903 | } |
1904 | } |
1904 | |
1905 | |
1905 | /* ------------------------------------------------------------------------- */ |
1906 | /* ------------------------------------------------------------------------- */ |
1906 | /* |
1907 | /* |
1907 | * Page the screen up/down nlines |
1908 | * Page the screen up/down nlines |
… | |
… | |
2678 | |
2679 | |
2679 | void |
2680 | void |
2680 | rxvt_term::selection_changed () NOTHROW |
2681 | rxvt_term::selection_changed () NOTHROW |
2681 | { |
2682 | { |
2682 | line_t &r1 = ROW (selection.beg.row); |
2683 | line_t &r1 = ROW (selection.beg.row); |
2683 | while (selection.beg.col > 0 && r1.t [selection.beg.col] == NOCHAR) |
2684 | while (selection.beg.col < r1.l && r1.t [selection.beg.col] == NOCHAR) |
2684 | --selection.beg.col; |
2685 | ++selection.beg.col; |
2685 | |
2686 | |
2686 | line_t &r2 = ROW (selection.end.row); |
2687 | line_t &r2 = ROW (selection.end.row); |
2687 | while (selection.end.col < r2.l && r2.t [selection.end.col] == NOCHAR) |
2688 | while (selection.end.col < r2.l && r2.t [selection.end.col] == NOCHAR) |
2688 | ++selection.end.col; |
2689 | ++selection.end.col; |
2689 | |
2690 | |