Commit f8c62b70 authored by Nick Roberts's avatar Nick Roberts

(coordinates_in_window): On the vertical border, calculate the row number

measured from the top of the window, not the top of the frame.
parent 6c7809b3
...@@ -661,12 +661,20 @@ coordinates_in_window (w, x, y) ...@@ -661,12 +661,20 @@ coordinates_in_window (w, x, y)
|| WINDOW_RIGHTMOST_P (w)) || WINDOW_RIGHTMOST_P (w))
{ {
if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width) if (!WINDOW_LEFTMOST_P (w) && abs (*x - x0) < grabbable_width)
return ON_VERTICAL_BORDER; {
*x = max (0, *x - x0);
*y -= top_y;
return ON_VERTICAL_BORDER;
}
} }
else else
{ {
if (abs (*x - x1) < grabbable_width) if (abs (*x - x1) < grabbable_width)
return ON_VERTICAL_BORDER; {
*x = min (x1, *x) - x0;
*y -= top_y;
return ON_VERTICAL_BORDER;
}
} }
if (*x < x0 || *x >= x1) if (*x < x0 || *x >= x1)
...@@ -708,7 +716,11 @@ coordinates_in_window (w, x, y) ...@@ -708,7 +716,11 @@ coordinates_in_window (w, x, y)
&& !WINDOW_HAS_VERTICAL_SCROLL_BAR (w) && !WINDOW_HAS_VERTICAL_SCROLL_BAR (w)
&& !WINDOW_RIGHTMOST_P (w) && !WINDOW_RIGHTMOST_P (w)
&& (abs (*x - right_x) < grabbable_width)) && (abs (*x - right_x) < grabbable_width))
return ON_VERTICAL_BORDER; {
*x = min (right_x, *x) - left_x;
*y -= top_y;
return ON_VERTICAL_BORDER;
}
} }
else else
{ {
...@@ -720,6 +732,8 @@ coordinates_in_window (w, x, y) ...@@ -720,6 +732,8 @@ coordinates_in_window (w, x, y)
{ {
/* On the border on the right side of the window? Assume that /* On the border on the right side of the window? Assume that
this area begins at RIGHT_X minus a canonical char width. */ this area begins at RIGHT_X minus a canonical char width. */
*x = min (right_x, *x) - left_x;
*y -= top_y;
return ON_VERTICAL_BORDER; return ON_VERTICAL_BORDER;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment