comparison src/window.c @ 66030:999beda71a39

(coordinates_in_window): Fix x position for ON_RIGHT_MARGIN. Fix x position for ON_TEXT when left margin width > 0.
author Kim F. Storm <storm@cua.dk>
date Tue, 11 Oct 2005 22:21:50 +0000
parents 7810bc0b0259
children c5b2598edd74 08b4dd6a6e87 5e2d3828e89f
comparison
equal deleted inserted replaced
66029:dce0cd9dbd1c 66030:999beda71a39
740 if (rmargin_width > 0 740 if (rmargin_width > 0
741 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) 741 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
742 ? (*x < right_x - WINDOW_RIGHT_FRINGE_WIDTH (w)) 742 ? (*x < right_x - WINDOW_RIGHT_FRINGE_WIDTH (w))
743 : (*x >= right_x - rmargin_width))) 743 : (*x >= right_x - rmargin_width)))
744 { 744 {
745 *x -= right_x; 745 *x -= right_x - rmargin_width;
746 if (!WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)) 746 if (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w))
747 *x -= WINDOW_RIGHT_FRINGE_WIDTH (w); 747 *x += WINDOW_RIGHT_FRINGE_WIDTH (w);
748 *y -= top_y; 748 *y -= top_y;
749 return ON_RIGHT_MARGIN; 749 return ON_RIGHT_MARGIN;
750 } 750 }
751 751
752 /* Convert X and Y to window-relative pixel coordinates. */ 752 /* Convert X and Y to window-relative pixel coordinates. */
754 *y -= top_y; 754 *y -= top_y;
755 return ON_RIGHT_FRINGE; 755 return ON_RIGHT_FRINGE;
756 } 756 }
757 757
758 /* Everything special ruled out - must be on text area */ 758 /* Everything special ruled out - must be on text area */
759 *x -= left_x + WINDOW_LEFT_FRINGE_WIDTH (w); 759 *x -= text_left;
760 *y -= top_y; 760 *y -= top_y;
761 return ON_TEXT; 761 return ON_TEXT;
762 } 762 }
763 763
764 764