x = Pixel2Col (x);
y = Pixel2Row (y);
- if (x < 0 || x >= ncol
- || y < 0 || y >= nrow)
+ if (!IN_RANGE_EXC (x, 0, ncol)
+ || !IN_RANGE_EXC (y, 0, nrow))
return;
for (;;)
{
- const line_t &l = save[y + saveLines - view_start];
+ const line_t &l = ROW(-view_start);
text_t t = l.t[x];
x--;
}
-
}
#endif
#define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth)
#define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight)
-#define TermWin_TotalWidth() ((int32_t)width)
-#define TermWin_TotalHeight() ((int32_t)height)
+#define TermWin_TotalWidth() ((int32_t)this->width)
+#define TermWin_TotalHeight() ((int32_t)this->height)
+
+#define LINENO(n) (((n) + term_start + total_rows) % total_rows)
+#define ROW(n) (save [LINENO (n)])
/* how to build & extract colors and attributes */
#define GET_BASEFG(x) (((x) & RS_fgMask))
#define ROWCOL_IN_ROW_AT_OR_BEFORE(X, Y) \
ROW_AND_COL_IN_ROW_AT_OR_BEFORE ((X).row, (X).col, (Y).row, (Y).col)
-#define LINENO(n) (((n) + term_start + total_rows) % total_rows)
-#define ROW(n) (save [LINENO (n)])
-
/*
* CLEAR_ROWS : clear <num> rows starting from row <row>
* CLEAR_CHARS: clear <num> chars starting from pixel position <x,y>
void
rxvt_term::selection_extend (int x, int y, int flag)
{
- int col = min (max (Pixel2Col (x), 0), nrow - 1);
- int row = min (max (Pixel2Row (y), 0), ncol);
+ int col = min (max (Pixel2Col (x), 0), ncol);
+ int row = min (max (Pixel2Row (y), 0), nrow - 1);
/*
* If we're selecting characters (single click) then we must check first