From b806edf4ac47d18e1a43fb8dbb5fbcad8d13192f Mon Sep 17 00:00:00 2001 From: Bryan O'Sullivan Date: Wed, 4 Nov 2009 14:59:23 -0800 Subject: Redo Bao's broken merge --- indra/newview/llviewertexteditor.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'indra/newview/llviewertexteditor.cpp') diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 5c40f2a540..90dff465c9 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -62,6 +62,7 @@ #include "lltooltip.h" #include "lltrans.h" #include "lluictrlfactory.h" +#include "llviewerassettype.h" #include "llviewercontrol.h" #include "llviewerinventory.h" #include "llviewertexturelist.h" @@ -505,19 +506,17 @@ LLUIImagePtr LLEmbeddedItems::getItemImage(llwchar ext_char) const } break; - case LLAssetType::AT_SOUND: img_name = "Inv_Sound"; break; + case LLAssetType::AT_SOUND: img_name = "Inv_Sound"; break; case LLAssetType::AT_CLOTHING: img_name = "Inv_Clothing"; break; - case LLAssetType::AT_OBJECT: img_name = "Inv_Object"; break; + case LLAssetType::AT_OBJECT: img_name = "Inv_Object"; break; case LLAssetType::AT_CALLINGCARD: img_name = "Inv_CallingCard"; break; - case LLAssetType::AT_LANDMARK: img_name = "Inv_Landmark"; break; + case LLAssetType::AT_LANDMARK: img_name = "Inv_Landmark"; break; case LLAssetType::AT_NOTECARD: img_name = "Inv_Notecard"; break; case LLAssetType::AT_LSL_TEXT: img_name = "Inv_Script"; break; - case LLAssetType::AT_BODYPART: img_name = "Inv_Skin"; break; - case LLAssetType::AT_ANIMATION: img_name = "Inv_Animation";break; - case LLAssetType::AT_GESTURE: img_name = "Inv_Gesture"; break; - //TODO need img_name - case LLAssetType::AT_FAVORITE: img_name = "Inv_Landmark"; break; - default: llassert(0); + case LLAssetType::AT_BODYPART: img_name = "Inv_Skin"; break; + case LLAssetType::AT_ANIMATION: img_name = "Inv_Animation"; break; + case LLAssetType::AT_GESTURE: img_name = "Inv_Gesture"; break; + default: llassert(0); } return LLUI::getUIImage(img_name); @@ -732,11 +731,10 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask) if( LLToolDragAndDrop::getInstance()->isOverThreshold( screen_x, screen_y ) ) { LLToolDragAndDrop::getInstance()->beginDrag( - LLAssetType::lookupDragAndDropType( mDragItem->getType() ), + LLViewerAssetType::lookupDragAndDropType( mDragItem->getType() ), mDragItem->getUUID(), LLToolDragAndDrop::SOURCE_NOTECARD, mPreviewID, mObjectID); - return LLToolDragAndDrop::getInstance()->handleHover( x, y, mask ); } getWindow()->setCursor(UI_CURSOR_HAND); -- cgit v1.2.3 From 83fb99a9ac2f07334233e7307cc18a4d340c8527 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 4 Nov 2009 18:28:45 -0800 Subject: ext-2038 - script editor, cursor becomes stuck in some rows ext-2037 0 Script editor, garbage characters inserted in text --- indra/newview/llviewertexteditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewertexteditor.cpp') diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 90dff465c9..75555efe7a 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -171,7 +171,7 @@ public: mToolTip = inv_item->getName() + '\n' + inv_item->getDescription(); } - /*virtual*/ void getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const + /*virtual*/ bool getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { if (num_chars == 0) { @@ -183,7 +183,7 @@ public: width = EMBEDDED_ITEM_LABEL_PADDING + mImage->getWidth() + mStyle->getFont()->getWidth(mLabel.c_str()); height = llmax(mImage->getHeight(), llceil(mStyle->getFont()->getLineHeight())); } - + return false; } /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const -- cgit v1.2.3 From 723a86f608879d192347039570e37bd1c04752e1 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 4 Nov 2009 19:00:40 -0800 Subject: fixed layout of items embedded in notecards --- indra/newview/llviewertexteditor.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewertexteditor.cpp') diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 75555efe7a..6f8818be6e 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -188,7 +188,24 @@ public: /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const { - return 1; + // always draw at beginning of line + if (line_offset == 0) + { + return 1; + } + else + { + S32 width, height; + getDimensions(mStart, 1, width, height); + if (width > num_pixels) + { + return 0; + } + else + { + return 1; + } + } } /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) { @@ -208,7 +225,7 @@ public: } F32 right_x; - mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mBottom, color, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::UNDERLINE, LLFontGL::NO_SHADOW, mLabel.length(), S32_MAX, &right_x); + mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::UNDERLINE, LLFontGL::NO_SHADOW, mLabel.length(), S32_MAX, &right_x); return right_x; } -- cgit v1.2.3