summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-10-27 21:35:20 +0000
committercorvid <corvid@lavabit.com>2011-10-27 21:35:20 +0000
commit42dedf95155ac83091d426bdd1813937bac5655f (patch)
tree4915957437dc700fb95a410c99594558520bb633
parent78923c9922251d31da4785f29e93a1ed4707dcfd (diff)
do more to pretend that a space at end of line is not there
-rw-r--r--dw/textblock.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 094a1601..02769e23 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -651,7 +651,10 @@ bool Textblock::sendSelectionEvent (core::SelectionState::EventType eventType,
if (event->xWidget >= nextWordStartX - word->effSpace) {
charPos = core::SelectionState::END_OF_WORD;
- if ((event->yWidget <=
+ if (wordIndex < line->lastWord &&
+ (words->getRef(wordIndex + 1)->content.type !=
+ core::Content::BREAK) &&
+ (event->yWidget <=
yWidgetBase + word->spaceStyle->font->descent) &&
(event->yWidget >
yWidgetBase - word->spaceStyle->font->ascent)) {
@@ -1562,7 +1565,10 @@ Textblock::Word *Textblock::findWord (int x, int y, bool *inSpace)
xCursor += word->size.width + word->effSpace;
if (lastXCursor <= x && xCursor > x) {
if (x >= xCursor - word->effSpace) {
- if (y > yWidgetBase - word->spaceStyle->font->ascent &&
+ if (wordIndex < line->lastWord &&
+ (words->getRef(wordIndex + 1)->content.type !=
+ core::Content::BREAK) &&
+ y > yWidgetBase - word->spaceStyle->font->ascent &&
y <= yWidgetBase + word->spaceStyle->font->descent) {
*inSpace = true;
return word;