Possible bug in Editor::NotifyMarginClick if X location is zero

11 views
Skip to first unread message

John Vella

unread,
Jul 10, 2012, 11:44:27 AM7/10/12
to scintilla...@googlegroups.com
If you have a margin click which occurs at the left-most pixel location of a margin, I don't think the notify code will fire. For example, if margin 0 is clicked with the X location equal to "0", then it won't be recognized in the following code:

bool Editor::NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt) {
int marginClicked = -1;
int x = 0;
for (int margin = 0; margin < ViewStyle::margins; margin++) {
if ((pt.x > x) && (pt.x < x + vs.ms[margin].width))

Shouldn't the first equality check be ">=" (ie "pt.x >= x")?

-John

Neil Hodgson

unread,
Jul 10, 2012, 7:55:31 PM7/10/12
to scintilla...@googlegroups.com
John Vella:

If you have a margin click which occurs at the left-most pixel location of a margin, I don't think the notify code will fire.
...
if ((pt.x > x) && (pt.x < x + vs.ms[margin].width))

Shouldn't the first equality check be ">=" (ie "pt.x >= x")?

   Yes, committed.

   Neil

Reply all
Reply to author
Forward
0 new messages