summaryrefslogtreecommitdiff
path: root/indra/llui/lltextbase.h
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2010-02-18 15:45:31 -0800
committerMonroe Linden <monroe@lindenlab.com>2010-02-18 15:45:31 -0800
commitef9b7c5b36c7521c4519e682aa312c4c25c31c2f (patch)
tree4ccefaed593f8ec9048e92449b487caf511fa338 /indra/llui/lltextbase.h
parent1d1e4c7abe5c46cfafbc351e8cad3197d2befefc (diff)
Fix for EXT-5120 "Mouse-up in the scrollbar to the right of a link in nearby chat window opens the link".
Added an optional bool parameter "hit_past_end_of_line" to LLTextBase:: getDocIndexFromLocalCoord() and getSegmentAtLocalPos(). Default is true, which gives the old behavior. If false, clicks past the end-of-line won't map to the last segment on the line. Made LLNormalTextSegment::handleHover(), handleRightMouseDown(), handleMouseDown(), and handleMouseUp() call getSegmentAtLocalPos() in this new mode before processing URL actions, and only do the processing if it returns the same segment. Reviewed by Richard.
Diffstat (limited to 'indra/llui/lltextbase.h')
-rw-r--r--indra/llui/lltextbase.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index 3dda6f4cc8..5b24c63557 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -48,6 +48,7 @@
class LLContextMenu;
class LLTextSegment;
+class LLNormalTextSegment;
typedef LLPointer<LLTextSegment> LLTextSegmentPtr;
@@ -61,6 +62,9 @@ class LLTextBase
protected LLEditMenuHandler
{
public:
+ friend class LLTextSegment;
+ friend class LLNormalTextSegment;
+
struct LineSpacingParams : public LLInitParam::Choice<LineSpacingParams>
{
Alternative<F32> multiple;
@@ -165,7 +169,7 @@ public:
S32 getVPad() { return mVPad; }
S32 getHPad() { return mHPad; }
- S32 getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const;
+ S32 getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round, bool hit_past_end_of_line = true) const;
LLRect getLocalRectFromDocIndex(S32 pos) const;
LLRect getDocRectFromDocIndex(S32 pos) const;
@@ -275,7 +279,7 @@ protected:
// manage segments
void getSegmentAndOffset( S32 startpos, segment_set_t::const_iterator* seg_iter, S32* offsetp ) const;
void getSegmentAndOffset( S32 startpos, segment_set_t::iterator* seg_iter, S32* offsetp );
- LLTextSegmentPtr getSegmentAtLocalPos( S32 x, S32 y );
+ LLTextSegmentPtr getSegmentAtLocalPos( S32 x, S32 y, bool hit_past_end_of_line = true);
segment_set_t::iterator getSegIterContaining(S32 index);
segment_set_t::const_iterator getSegIterContaining(S32 index) const;
void clearSegments();