aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2003-06-05 00:36:28 +0000
committerKim F. Storm2003-06-05 00:36:28 +0000
commita530382071fde731cc36c549ee9086ca19a345fb (patch)
treeae61eaa713af4897b5254a9b290480fdc5bf60d9 /src
parent9b87a0bc64cc1e2e54083e2d7ff411c3c7a7aaba (diff)
downloademacs-a530382071fde731cc36c549ee9086ca19a345fb.tar.gz
emacs-a530382071fde731cc36c549ee9086ca19a345fb.zip
(coordinates_in_window): Convert X and Y to window
relative coordinates inside mode-line and header-line parts. Convert X and Y to margin area relative coordinates inside left and right display margin parts.
Diffstat (limited to 'src')
-rw-r--r--src/window.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/window.c b/src/window.c
index f5f67a627f6..b323bb5fcb8 100644
--- a/src/window.c
+++ b/src/window.c
@@ -654,6 +654,10 @@ coordinates_in_window (w, x, y)
654 return ON_VERTICAL_BORDER; 654 return ON_VERTICAL_BORDER;
655 } 655 }
656 656
657 /* Convert X and Y to window relative coordinates.
658 Mode line starts at left edge of window. */
659 *x -= x0;
660 *y -= top_y;
657 return part; 661 return part;
658 } 662 }
659 663
@@ -703,7 +707,13 @@ coordinates_in_window (w, x, y)
703 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) 707 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
704 ? (*x >= left_x + WINDOW_LEFT_FRINGE_WIDTH (w)) 708 ? (*x >= left_x + WINDOW_LEFT_FRINGE_WIDTH (w))
705 : (*x < left_x + lmargin_width))) 709 : (*x < left_x + lmargin_width)))
706 return ON_LEFT_MARGIN; 710 {
711 *x -= x0;
712 if (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w))
713 *x -= WINDOW_LEFT_FRINGE_WIDTH (w);
714 *y -= top_y;
715 return ON_LEFT_MARGIN;
716 }
707 717
708 /* Convert X and Y to window-relative pixel coordinates. */ 718 /* Convert X and Y to window-relative pixel coordinates. */
709 *x -= left_x; 719 *x -= left_x;
@@ -717,7 +727,13 @@ coordinates_in_window (w, x, y)
717 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) 727 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
718 ? (*x < right_x - WINDOW_RIGHT_FRINGE_WIDTH (w)) 728 ? (*x < right_x - WINDOW_RIGHT_FRINGE_WIDTH (w))
719 : (*x >= right_x - rmargin_width))) 729 : (*x >= right_x - rmargin_width)))
720 return ON_RIGHT_MARGIN; 730 {
731 *x -= right_x;
732 if (!WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w))
733 *x -= WINDOW_RIGHT_FRINGE_WIDTH (w);
734 *y -= top_y;
735 return ON_RIGHT_MARGIN;
736 }
721 737
722 /* Convert X and Y to window-relative pixel coordinates. */ 738 /* Convert X and Y to window-relative pixel coordinates. */
723 *x -= left_x + WINDOW_LEFT_FRINGE_WIDTH (w); 739 *x -= left_x + WINDOW_LEFT_FRINGE_WIDTH (w);