Files
UnrealEngineUWP/Engine/Source/Runtime/Slate/Private/Framework/Text/RunUtils.cpp
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

31 lines
980 B
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "Framework/Text/RunUtils.h"
#include "Framework/Text/TextHitPoint.h"
ETextHitPoint RunUtils::CalculateTextHitPoint(const int32 InIndex, const FTextRange& InTextRange, const TextBiDi::ETextDirection InTextDirection)
{
//if (InTextDirection == TextBiDi::ETextDirection::LeftToRight)
{
return (InIndex == InTextRange.EndIndex) ? ETextHitPoint::RightGutter : ETextHitPoint::WithinText;
}
/*
else
{
return (InIndex == InTextRange.BeginIndex) ? ETextHitPoint::RightGutter : ETextHitPoint::WithinText;
}
*/
}
FTextRange RunUtils::CalculateOffsetMeasureRange(const int32 InOffset, const FTextRange& InTextRange, const TextBiDi::ETextDirection InTextDirection)
{
if (InTextDirection == TextBiDi::ETextDirection::LeftToRight)
{
return FTextRange(InTextRange.BeginIndex, InTextRange.BeginIndex + InOffset);
}
else
{
return FTextRange(InTextRange.BeginIndex + InOffset, InTextRange.EndIndex);
}
}