Skip to content

Commit 1a2f733

Browse files
authored
Merge branch 'develop-linux' into rye/linux64
2 parents 17fd0f6 + fa05510 commit 1a2f733

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

indra/llui/lltextbase.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,37 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s
10381038
{
10391039
LLStyleSP emoji_style;
10401040
LLEmojiDictionary* ed = LLEmojiDictionary::instanceExists() ? LLEmojiDictionary::getInstance() : NULL;
1041+
LLTextSegment* segmentp = nullptr;
1042+
segment_vec_t::iterator seg_iter;
1043+
if (segments && segments->size() > 0)
1044+
{
1045+
seg_iter = segments->begin();
1046+
segmentp = *seg_iter;
1047+
}
10411048
for (S32 text_kitty = 0, text_len = static_cast<S32>(wstr.size()); text_kitty < text_len; text_kitty++)
10421049
{
1050+
if (segmentp)
1051+
{
1052+
if (segmentp->getEnd() <= pos + text_kitty)
1053+
{
1054+
seg_iter++;
1055+
if (seg_iter != segments->end())
1056+
{
1057+
segmentp = *seg_iter;
1058+
}
1059+
else
1060+
{
1061+
segmentp = nullptr;
1062+
}
1063+
}
1064+
if (segmentp && !segmentp->getPermitsEmoji())
1065+
{
1066+
// Some segments, like LLInlineViewSegment do not permit splitting
1067+
// and should not be interrupted by emoji segments
1068+
continue;
1069+
}
1070+
}
1071+
10431072
llwchar code = wstr[text_kitty];
10441073
bool isEmoji = ed ? ed->isEmoji(code) : LLStringOps::isEmoji(code);
10451074
if (isEmoji)
@@ -3448,6 +3477,7 @@ S32 LLTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offs
34483477
void LLTextSegment::updateLayout(const LLTextBase& editor) {}
34493478
F32 LLTextSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect) { return draw_rect.mLeft; }
34503479
bool LLTextSegment::canEdit() const { return false; }
3480+
bool LLTextSegment::getPermitsEmoji() const { return true; }
34513481
void LLTextSegment::unlinkFromDocument(LLTextBase*) {}
34523482
void LLTextSegment::linkToDocument(LLTextBase*) {}
34533483
const LLUIColor& LLTextSegment::getColor() const { static const LLUIColor white = LLUIColorTable::instance().getColor("White", LLColor4::white); return white; }

indra/llui/lltextbase.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class LLTextSegment
8787
virtual void updateLayout(const class LLTextBase& editor);
8888
virtual F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect);
8989
virtual bool canEdit() const;
90+
virtual bool getPermitsEmoji() const;
9091
virtual void unlinkFromDocument(class LLTextBase* editor);
9192
virtual void linkToDocument(class LLTextBase* editor);
9293

@@ -255,6 +256,7 @@ class LLInlineViewSegment : public LLTextSegment
255256
/*virtual*/ void updateLayout(const class LLTextBase& editor);
256257
/*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRectf& draw_rect);
257258
/*virtual*/ bool canEdit() const { return false; }
259+
/*virtual*/ bool getPermitsEmoji() const { return false; }
258260
/*virtual*/ void unlinkFromDocument(class LLTextBase* editor);
259261
/*virtual*/ void linkToDocument(class LLTextBase* editor);
260262

indra/newview/llgltfmaterialpreviewmgr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ bool LLGLTFPreviewTexture::render()
462462
// Set up camera and viewport
463463
const LLVector3 origin(0.0, 0.0, 0.0);
464464
camera.lookAt(origin, object_position);
465-
camera.setAspect((F32)(mFullHeight / mFullWidth));
465+
camera.setAspect((F32)(mFullWidth / mFullHeight));
466466
const LLRect texture_rect(0, mFullHeight, mFullWidth, 0);
467467
camera.setPerspective(NOT_FOR_SELECTION, texture_rect.mLeft, texture_rect.mBottom, texture_rect.getWidth(), texture_rect.getHeight(), false, camera.getNear(), MAX_FAR_CLIP*2.f);
468468

indra/newview/llterrainpaintmap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ bool LLTerrainPaintMap::bakeHeightNoiseIntoPBRPaintMapRGB(const LLViewerRegion&
107107
const LLVector3 region_center = LLVector3(region_half_width, region_half_width, 0.0) + region.getOriginAgent();
108108
const LLVector3 camera_origin = LLVector3(0.0f, 0.0f, region_camera_height) + region_center;
109109
camera.lookAt(camera_origin, region_center, LLVector3::y_axis);
110-
camera.setAspect(F32(scratch_target.getHeight()) / F32(scratch_target.getWidth()));
110+
camera.setAspect(F32(scratch_target.getWidth()) / F32(scratch_target.getHeight()));
111111
const LLRect texture_rect(0, scratch_target.getHeight(), scratch_target.getWidth(), 0);
112112
glViewport(texture_rect.mLeft, texture_rect.mBottom, texture_rect.getWidth(), texture_rect.getHeight());
113113
// Manually get modelview matrix from camera orientation.

0 commit comments

Comments
 (0)