result
_EnrichedTextImpl::Construct(const Tizen::Graphics::Dimension& dim)
{
+ FloatDimension dimF = _CoordinateSystemUtils::ConvertToFloat(dim);
+
+ return Construct(dimF);
+}
+
+result
+_EnrichedTextImpl::Construct(const Tizen::Graphics::FloatDimension& dim)
+{
SysTryReturn(NID_GRP, (dim.width > 0) && (dim.height > 0), E_INVALID_ARG, E_INVALID_ARG
, "[E_INVALID_ARG] The argument is invalid. (width = %d height = %d)", dim.width, dim.height);
, r = E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[%s] Fails to create a TextObject.", GetErrorMessage(r));
__pTextObject->Construct();
- __pTextObject->SetBounds(Rectangle(0, 0, __width, __height));
+ __pTextObject->SetBounds(FloatRectangle(0, 0, __width, __height));
__pTextObject->SetCutLinkViewMode(true);
__pTextObject->SetAlignment(TEXT_OBJECT_ALIGNMENT_LEFT);
__pTextObject->HideFrontSpace(TEXT_OBJECT_SPACE_HIDE_TYPE_ONE);
}
result
-_EnrichedTextImpl::Construct(const Tizen::Graphics::FloatDimension& dim)
-{
- Dimension newDim = _CoordinateSystemUtils::ConvertToInteger(dim);
- return Construct(newDim);
-}
-
-result
_EnrichedTextImpl::InsertAt(int elementIndex, Tizen::Graphics::TextElement& element)
{
SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
result
_EnrichedTextImpl::SetSize(const Tizen::Graphics::Dimension& size)
{
+ FloatDimension sizeF = _CoordinateSystemUtils::ConvertToFloat(size);
+
+ return SetSize(sizeF);
+}
+
+result
+_EnrichedTextImpl::SetSize(const Tizen::Graphics::FloatDimension& size)
+{
SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
SysTryReturn(NID_GRP, (size.width > 0) && (size.height > 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE
, "[E_OUT_OF_RANGE] The given rectangle(width:%d,height:%d) is out of range.\n", size.width, size.height);
- Rectangle rect(0, 0, size.width, size.height);
+ FloatRectangle rect(0, 0, size.width, size.height);
__pTextObject->SetBounds(rect);
__width = rect.width;
}
result
-_EnrichedTextImpl::SetSize(const Tizen::Graphics::FloatDimension& size)
+_EnrichedTextImpl::SetSize(int width, int height)
{
- Dimension newSize = _CoordinateSystemUtils::ConvertToInteger(size);
- return SetSize(newSize);
+ return SetSize(_CoordinateSystemUtils::ConvertToFloat(width),_CoordinateSystemUtils::ConvertToFloat(height));
}
result
-_EnrichedTextImpl::SetSize(int width, int height)
+_EnrichedTextImpl::SetSize(float width, float height)
{
SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
SysTryReturn(NID_GRP, (width > 0) && (height > 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE
, "[E_OUT_OF_RANGE] The given rectangle(width:%d,height:%d) is out of range.\n", width, height);
- Dimension dim(width, height);
+ FloatDimension dim(width, height);
result r = SetSize(dim);
return r;
}
-result
-_EnrichedTextImpl::SetSize(float width, float height)
-{
- return SetSize(_CoordinateSystemUtils::ConvertToInteger(width),_CoordinateSystemUtils::ConvertToInteger(height));
-}
-
Tizen::Graphics::Dimension
_EnrichedTextImpl::GetSize(void) const
{
Dimension dim;
- dim.width = __width;
- dim.height = __height;
+ dim.width = _CoordinateSystemUtils::ConvertToInteger(__width);
+ dim.height = _CoordinateSystemUtils::ConvertToInteger(__height);
return dim;
}
Tizen::Graphics::FloatDimension
_EnrichedTextImpl::GetSizeF(void) const
{
- SysTryReturn(NID_GRP, __pTextObject != null, FloatDimension(0.0f, 0.0f), E_OPERATION_FAILED
+ SysTryReturn(NID_GRP, __pTextObject != null, FloatDimension(0, 0), E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
FloatDimension dim;
- dim.width = _CoordinateSystemUtils::ConvertToFloat(__width);
- dim.height = _CoordinateSystemUtils::ConvertToFloat(__height);
+ dim.width = __width;
+ dim.height = __height;
return dim;
}
SysTryReturn(NID_GRP, __pTextObject != null, , E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
- width = __width;
- height = __height;
+ width = _CoordinateSystemUtils::ConvertToInteger(__width);
+ height = _CoordinateSystemUtils::ConvertToInteger(__height);
}
void
SysTryReturn(NID_GRP, __pTextObject != null, , E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
- width = _CoordinateSystemUtils::ConvertToFloat(__width);
- height = _CoordinateSystemUtils::ConvertToFloat(__height);
+ width = __width;
+ height = __height;
}
int
SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
- return __width;
+ return _CoordinateSystemUtils::ConvertToInteger(__width);
}
float
SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
- return _CoordinateSystemUtils::ConvertToFloat(__width);
+ return __width;
}
int
SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
- return __height;
+ return _CoordinateSystemUtils::ConvertToInteger(__height);
}
float
SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
- return _CoordinateSystemUtils::ConvertToFloat(__height);
+ return __height;
}
result
SysTryReturn(NID_GRP, lineSpace > 0, E_INVALID_ARG, E_INVALID_ARG
, "[E_INVALID_ARG] The argument is invalid.");
- __lineSpace = lineSpace;
+ __lineSpace = _CoordinateSystemUtils::ConvertToFloat(lineSpace);
__pTextObject->SetLineSpace(__lineSpace);
return E_SUCCESS;
SysTryReturn(NID_GRP, lineSpace > 0, E_INVALID_ARG, E_INVALID_ARG
, "[E_INVALID_ARG] The argument is invalid.");
- __lineSpace = _CoordinateSystemUtils::ConvertToInteger(lineSpace);
+ __lineSpace = lineSpace;
__pTextObject->SetLineSpace(__lineSpace);
return E_SUCCESS;
int
_EnrichedTextImpl::GetLineSpace(void) const
{
- return __lineSpace;
+ return _CoordinateSystemUtils::ConvertToInteger(__lineSpace);
}
float
_EnrichedTextImpl::GetLineSpaceF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(__lineSpace);
+ return __lineSpace;
}
void
int
_EnrichedTextImpl::GetTotalLineHeight(void) const
{
+ return _CoordinateSystemUtils::ConvertToInteger(GetTotalLineHeightF());
+}
+
+float
+_EnrichedTextImpl::GetTotalLineHeightF(void) const
+{
SysTryReturn(NID_GRP, __pTextObject != null, 0, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
- int height = __pTextObject->GetTotalHeight();
-
__pTextObject->Compose();
+ float height = __pTextObject->GetTotalHeightF();
return height;
}
-float
-_EnrichedTextImpl::GetTotalLineHeightF(void) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetTotalLineHeight());
-}
-
int
_EnrichedTextImpl::GetDisplayLineCount(void) const
{
int
_EnrichedTextImpl::GetLineHeight(int lineIndex) const
{
+ return _CoordinateSystemUtils::ConvertToInteger(GetLineHeightF(lineIndex));
+}
+
+float
+_EnrichedTextImpl::GetLineHeightF(int lineIndex) const
+{
SysTryReturn(NID_GRP, __pTextObject != null, -1, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
SysTryReturn(NID_GRP, lineIndex >= 0, -1, E_INVALID_ARG
return -1;
}
- int height = __pTextObject->GetLineHeightAt(lineIndex);
+ float height = __pTextObject->GetLineHeightAtF(lineIndex);
SetLastResult(E_SUCCESS);
return height;
}
-float
-_EnrichedTextImpl::GetLineHeightF(int lineIndex) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetLineHeight(lineIndex));
-}
-
int
_EnrichedTextImpl::GetTextLength(void) const
{
result
_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, int& width, int& height, int& actualLength) const
{
+ float widthF = _CoordinateSystemUtils::ConvertToFloat(width);
+ float heightF = _CoordinateSystemUtils::ConvertToFloat(height);
+
+ result r = GetTextExtent(startTextIndex, textLength, widthF, heightF, actualLength);
+
+ width = _CoordinateSystemUtils::ConvertToInteger(widthF);
+ height = _CoordinateSystemUtils::ConvertToInteger(heightF);
+
+ return r;
+}
+
+result
+_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, float& width, float& height, int& actualLength) const
+{
SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
SysTryReturn(NID_GRP, textLength >= 0, E_INVALID_ARG, E_INVALID_ARG
SysTryReturn(NID_GRP, startTextIndex <= GetTextLength(), E_INVALID_ARG, E_INVALID_ARG
, "[E_INVALID_ARG] 'startTextIndex' is greater than or equal to the text length.");
- Dimension textSize;
+ FloatDimension textSize;
actualLength = 0;
}
__pTextObject->Compose();
- textSize = __pTextObject->GetTextExtent(startTextIndex, textLength);
+ textSize = __pTextObject->GetTextExtentF(startTextIndex, textLength);
width = textSize.width;
height = textSize.height;
return E_SUCCESS;
}
+
result
-_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, float& width, float& height, int& actualLength) const
+_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::Dimension& size, int &actualLength) const
{
- int intWidth = _CoordinateSystemUtils::ConvertToInteger(width);
- int intHeight = _CoordinateSystemUtils::ConvertToInteger(height);
+ FloatDimension sizeF = _CoordinateSystemUtils::ConvertToFloat(size);
- result r = GetTextExtent(startTextIndex, textLength, intWidth, intHeight, actualLength);
+ result r = GetTextExtent(startTextIndex, textLength, sizeF, actualLength);
- width = _CoordinateSystemUtils::ConvertToFloat(intWidth);
- height = _CoordinateSystemUtils::ConvertToFloat(intHeight);
+ size = _CoordinateSystemUtils::ConvertToInteger(sizeF);
return r;
}
-
result
-_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::Dimension& size, int &actualLength) const
+_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::FloatDimension& size, int &actualLength) const
{
SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.\n");
SysTryReturn(NID_GRP, textLength >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The given text length(%d) is invalid\n", textLength);
__pTextObject->Compose();
- size = __pTextObject->GetTextExtent(startTextIndex, textLength);
+ size = __pTextObject->GetTextExtentF(startTextIndex, textLength);
if (GetTextLength() - startTextIndex > textLength)
{
actualLength = textLength;
return E_SUCCESS;
}
-result
-_EnrichedTextImpl::GetTextExtent(int startTextIndex, int textLength, Tizen::Graphics::FloatDimension& size, int &actualLength) const
+Tizen::Graphics::Dimension
+_EnrichedTextImpl::GetTextExtent(void) const
{
- Dimension intSize = _CoordinateSystemUtils::ConvertToInteger(size);
-
- result r = GetTextExtent(startTextIndex, textLength, intSize, actualLength);
-
- size = _CoordinateSystemUtils::ConvertToFloat(intSize);
-
- return r;
+ return _CoordinateSystemUtils::ConvertToInteger(GetTextExtentF());
}
-Tizen::Graphics::Dimension
-_EnrichedTextImpl::GetTextExtent(void) const
+Tizen::Graphics::FloatDimension
+_EnrichedTextImpl::GetTextExtentF(void) const
{
- SysTryReturn(NID_GRP, __pTextObject != null, Dimension(-1, -1), E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.\n");
+ SysTryReturn(NID_GRP, __pTextObject != null, FloatDimension(-1, -1), E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not constructed yet.\n");
- Dimension size(0,0);
+ FloatDimension size(0,0);
if (GetTextLength() == 0)
{
return size;
__pTextObject->Compose();
- Rectangle rtBound = __pTextObject->GetBounds();
- if (rtBound.width >= 0 && rtBound.height >= 0)
+ FloatRectangle rtBound = __pTextObject->GetBoundsF();
+ if (rtBound.width >= 0.0f && rtBound.height >= 0.0f)
{
size.width = rtBound.width;
- size.height = __pTextObject->GetTotalHeight();
+ size.height = __pTextObject->GetTotalHeightF();
return size;
}
}
}
-Tizen::Graphics::FloatDimension
-_EnrichedTextImpl::GetTextExtentF(void) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetTextExtent());
-}
-
result
_EnrichedTextImpl::Add(const Tizen::Graphics::Bitmap& bitmap)
{
return E_OUT_OF_MEMORY;
}
- r = pNewBitmap->Construct(*pBitmap, Rectangle(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight()));
+ r = pNewBitmap->Construct(*pBitmap, FloatRectangle(0, 0, pBitmap->GetWidthF(), pBitmap->GetHeightF()));
SysTryCatch(NID_GRP
, r == E_SUCCESS
, , r, "[%s] Fails to append image.", GetErrorMessage(r));
return E_OUT_OF_MEMORY;
}
- r = pNewBitmap->Construct(*pBitmap, Rectangle(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight()));
+ r = pNewBitmap->Construct(*pBitmap, FloatRectangle(0, 0, pBitmap->GetWidthF(), pBitmap->GetHeightF()));
SysTryCatch(NID_GRP
, r == E_SUCCESS
, , r, "[%s] Fails to insert image.", GetErrorMessage(r));
result
_EnrichedTextImpl::GetLinkInfoFromPosition(const Point& point, Tizen::Base::Utility::LinkInfo& linkInfo) const
{
+ return GetLinkInfoFromPosition(_CoordinateSystemUtils::ConvertToFloat(point), linkInfo);
+}
+
+result
+_EnrichedTextImpl::GetLinkInfoFromPosition(const FloatPoint& point, Tizen::Base::Utility::LinkInfo& linkInfo) const
+{
SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
SysTryReturn(NID_GRP, GetTextElementCount() > 0, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND
, "[E_OBJ_NOT_FOUND] The TextElement does not exist.");
- SysTryReturn(NID_GRP, point.x >= 0 && point.y >= 0, E_INVALID_ARG, E_INVALID_ARG
+ SysTryReturn(NID_GRP, point.x >= 0.0f && point.y >= 0.0f, E_INVALID_ARG, E_INVALID_ARG
, "[E_INVALID_ARG] The invalid position is given.");
- SysTryReturn(NID_GRP, GetWidth() >= point.x && GetHeight() >= point.y, E_INVALID_ARG, E_INVALID_ARG
+ SysTryReturn(NID_GRP, GetWidthF() >= point.x && GetHeightF() >= point.y, E_INVALID_ARG, E_INVALID_ARG
, "[E_INVALID_ARG] The invalid position is given.");
return GetLinkInfoFromPosition(point.x, point.y, linkInfo);
}
result
-_EnrichedTextImpl::GetLinkInfoFromPosition(const FloatPoint& point, Tizen::Base::Utility::LinkInfo& linkInfo) const
+_EnrichedTextImpl::GetLinkInfoFromPosition(int x, int y, Tizen::Base::Utility::LinkInfo& linkInfo) const
{
- return GetLinkInfoFromPosition(_CoordinateSystemUtils::ConvertToInteger(point), linkInfo);
+ return GetLinkInfoFromPosition(_CoordinateSystemUtils::ConvertToFloat(x), _CoordinateSystemUtils::ConvertToFloat(y), linkInfo);
}
result
-_EnrichedTextImpl::GetLinkInfoFromPosition(int x, int y, Tizen::Base::Utility::LinkInfo& linkInfo) const
+_EnrichedTextImpl::GetLinkInfoFromPosition(float x, float y, Tizen::Base::Utility::LinkInfo& linkInfo) const
{
SysTryReturn(NID_GRP, __pTextObject != null, E_OPERATION_FAILED, E_OPERATION_FAILED
, "[E_OPERATION_FAILED] This instance is not constructed yet.");
SysTryReturn(NID_GRP, GetTextElementCount() > 0, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND
, "[E_OBJ_NOT_FOUND] The TextElement does not exist.");
- SysTryReturn(NID_GRP, x >= 0 && y >= 0, E_INVALID_ARG, E_INVALID_ARG
+ SysTryReturn(NID_GRP, x >= 0.0f && y >= 0.0f, E_INVALID_ARG, E_INVALID_ARG
, "[E_INVALID_ARG] The invalid position is given.");
- SysTryReturn(NID_GRP, GetWidth() >= x && GetHeight() >= y, E_INVALID_ARG, E_INVALID_ARG
+ SysTryReturn(NID_GRP, GetWidthF() >= x && GetHeightF() >= y, E_INVALID_ARG, E_INVALID_ARG
, "[E_INVALID_ARG] The invalid position is given.");
- Point point(x, y);
+ FloatPoint point(x, y);
int textElementIndex = GetTextElementIndexFromPosition(point);
return E_SUCCESS;
}
-result
-_EnrichedTextImpl::GetLinkInfoFromPosition(float x, float y, Tizen::Base::Utility::LinkInfo& linkInfo) const
-{
- return GetLinkInfoFromPosition(_CoordinateSystemUtils::ConvertToInteger(x), _CoordinateSystemUtils::ConvertToInteger(y), linkInfo);
-}
-
TextVerticalAlignment
_EnrichedTextImpl::GetElementVerticalAlignment(void) const
{
Tizen::Graphics::Rectangle
_EnrichedTextImpl::GetBounds() const
{
- Rectangle rect(0, 0, __width, __height);
+ Rectangle rect(0, 0, _CoordinateSystemUtils::ConvertToInteger(__width), _CoordinateSystemUtils::ConvertToInteger(__height));
return rect;
}
Tizen::Graphics::FloatRectangle
_EnrichedTextImpl::GetBoundsF() const
{
- float newWidth = _CoordinateSystemUtils::ConvertToFloat(__width);
- float newHeight = _CoordinateSystemUtils::ConvertToFloat(__height);
- FloatRectangle rect(0.0f, 0.0f, newWidth, newHeight);
+ FloatRectangle rect(0, 0, __width, __height);
return rect;
}
int
_EnrichedTextImpl::GetTextElementIndexFromPosition(Tizen::Graphics::Point& point) const
{
+ FloatPoint pointF = _CoordinateSystemUtils::ConvertToFloat(point);
+
+ return GetTextElementIndexFromPosition(pointF);
+}
+
+int
+_EnrichedTextImpl::GetTextElementIndexFromPosition(Tizen::Graphics::FloatPoint& point) const
+{
_TextElementImpl* pElement = null;
TextElementType type;
int length = 0;
return -1;
}
-int
-_EnrichedTextImpl::GetTextElementIndexFromPosition(Tizen::Graphics::FloatPoint& point) const
-{
- Point intPoint = _CoordinateSystemUtils::ConvertToInteger(point);
- return GetTextElementIndexFromPosition(intPoint);
-}
-
TextObject*
_EnrichedTextImpl::GetTextObject(void) const
{
int
_EnrichedTextImpl::GetIndexFromTouchPosition(int posX, int posY) const
{
- return __pTextObject->GetTextIndexFromPosition(posX, posY, true);
+ return GetIndexFromTouchPosition(_CoordinateSystemUtils::ConvertToFloat(posX), _CoordinateSystemUtils::ConvertToFloat(posY));
}
int
_EnrichedTextImpl::GetIndexFromTouchPosition(float posX, float posY) const
{
- return GetIndexFromTouchPosition(_CoordinateSystemUtils::ConvertToInteger(posX), _CoordinateSystemUtils::ConvertToInteger(posY));
+ return __pTextObject->GetTextIndexFromPosition(posX, posY, true);
}
result
SysTryReturnVoidResult(NID_GRP, rhs.__pTextObject, E_OPERATION_FAILED, "[E_OPERATION_FAILED] This instance is not initialized.");
result r = E_SUCCESS;
- Dimension size = rhs.GetSize();
+ FloatDimension size = rhs.GetSizeF();
__width = size.width;
__height = size.height;
- __lineSpace = GetLineSpace();
+ __lineSpace = GetLineSpaceF();
__count = 0;
__verticalAlignment = rhs.GetVerticalAlignment();
__horizontalAlignment = rhs.GetHorizontalAlignment();
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
- if (__rect.width == 0 || __rect.height == 0)
+ if (__rect.width == 0.0f || __rect.height == 0.0f)
{
return E_SUCCESS;
}
float totalHeight = 0;
float slidingWidth = 0;
- SysTryReturn(NID_GRP, __rect.width > 0 && __rect.height > 0, E_INVALID_STATE, E_INVALID_STATE
+ SysTryReturn(NID_GRP, __rect.width > 0.0f && __rect.height > 0.0f, E_INVALID_STATE, E_INVALID_STATE
, "[E_INVALID_STATE] This instance is not constructed yet. (width = %d, height = %d)", __rect.width, __rect.height);
r = Compose();
if (__pTextColumn->GetTotalLineCount() <= 1)
{
__pTextColumn->SetFirstDisplayLineIndex(0);
- __pTextColumn->SetFirstDisplayPositionY(0);
+ __pTextColumn->SetFirstDisplayPositionY(0.0f);
}
targetBounds = __rect;
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- targetBounds.y += (targetBounds.height - totalHeight) / 2;
+ targetBounds.y += (targetBounds.height - totalHeight) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- targetBounds.y += (targetBounds.height - totalHeight) / 2;
+ targetBounds.y += (targetBounds.height - totalHeight) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
finalClipRect.width = (clipRect.x + clipRect.width > targetBounds.x + targetBounds.width) ? (targetBounds.x + targetBounds.width) - finalClipRect.x : (clipRect.x + clipRect.width) - finalClipRect.x;
finalClipRect.height = (clipRect.y + clipRect.height > targetBounds.y + targetBounds.height) ? (targetBounds.y + targetBounds.height) - finalClipRect.y : (clipRect.y + clipRect.height) - finalClipRect.y;
- SysTryReturn(NID_GRP, 0 <= finalClipRect.width && 0 <= finalClipRect.height, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get clip rectangle.");
+ SysTryReturn(NID_GRP, 0.0f <= finalClipRect.width && 0.0f <= finalClipRect.height, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get clip rectangle.");
canvasImpl.SetClipBounds(finalClipRect);
case TEXT_OBJECT_ACTION_TYPE_SLIDE_UP:
{
FloatRectangle slidingRect = targetBounds;
- slidingRect.y += __pTextColumn->GetSlidingPosition();
+ slidingRect.y += __pTextColumn->GetSlidingPositionF();
int lineCount = __pTextColumn->GetTotalLineCount();
for (int i = 0; i < lineCount; i++)
result r = E_SUCCESS;
TextLine* pTextLine = null;
FloatRectangle lineBounds;
- int firstDisplayY = __pTextColumn->GetFirstDisplayPositionY();
+ float firstDisplayY = __pTextColumn->GetFirstDisplayPositionYF();
r = Compose();
SysTryReturn(NID_GRP, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
}
else
{
- if (0 < slidingStartIndex + slidingDim.width)
+ if (0.0f < slidingStartIndex + slidingDim.width)
{
slidingStartIndex -= __slidingStep;
}
break;
case TEXT_OBJECT_ACTION_TYPE_SLIDE_UP:
- if (slidingStartIndex + slidingDim.height >= 0)
+ if (slidingStartIndex + slidingDim.height >= 0.0f)
{
slidingStartIndex -= __slidingStep;
}
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
- SysTryReturn(NID_GRP, __rect.width >= 0 && __rect.height >= 0, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
+ SysTryReturn(NID_GRP, __rect.width >= 0.0f && __rect.height >= 0.0f, E_INVALID_STATE, E_INVALID_STATE, "[E_INVALID_STATE] This instance is not constructed yet.");
int lineCount = 0;
FloatRectangle rect = __rect;
{
__pTextColumn->SetChangeAction(TextColumn::TEXT_CHANGE_UNKONWN, 0, 0);
__pTextColumn->SetFirstDisplayLineIndex(0);
- __pTextColumn->SetFirstDisplayPositionY(0);
+ __pTextColumn->SetFirstDisplayPositionY(0.0f);
}
ResetSweepInfo();
if (lineLength < totalLength)
{
__isActionOn = true;
- __pTextColumn->SetSlidingPosition(0);
+ __pTextColumn->SetSlidingPosition(0.0f);
FloatDimension slidingDim;
FloatDimension lineTextSize;
case TEXT_OBJECT_ACTION_TYPE_SLIDE_UP:
{
- __pTextColumn->SetSlidingPosition(0);
+ __pTextColumn->SetSlidingPosition(0.0f);
float totalHeight = __pTextColumn->GetTotalHeightF();
FloatDimension slidingDim;
result r = E_SUCCESS;
FloatRectangle lineBounds;
TextLine* pTextLine = null;
- float firstDisplayPositionY = 0;
- float rollbackFirstDisplayPositionY = 0;
+ float firstDisplayPositionY = 0.0f;
+ float rollbackFirstDisplayPositionY = 0.0f;
int rollbackFirstDisplayLineIndex = 0;
rollbackFirstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
float firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
- bool isDisplayedAtStartPosition = (firstDisplayPositionY == 0) ? true : false;
+ bool isDisplayedAtStartPosition = (firstDisplayPositionY == 0.0f) ? true : false;
return isDisplayedAtStartPosition;
}
{
IF_NOT_CONSTRUCTED(return false);
- float totalHeight = 0;
- float firstDisplayPositionY = 0;
+ float totalHeight = 0.0f;
+ float firstDisplayPositionY = 0.0f;
firstDisplayPositionY = __pTextColumn->GetFirstDisplayPositionYF();
totalHeight = __pTextColumn->GetTotalHeightF();
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
- SysTryReturn(NID_GRP, (rect.width >= 0) && (rect.height >= 0), E_OUT_OF_RANGE, E_OUT_OF_RANGE
+ SysTryReturn(NID_GRP, (rect.width >= 0.0f) && (rect.height >= 0.0f), E_OUT_OF_RANGE, E_OUT_OF_RANGE
, "[E_OUT_OF_RANGE] The given rectangle(width:%d,height:%d) is out of range.\n", rect.width, rect.height);
if (__rect.width != rect.width)
{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
- SysTryReturn(NID_GRP, lineSpacing >= 0, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. lineSpacing(%d)", lineSpacing);
+ SysTryReturn(NID_GRP, lineSpacing >= 0.0f, E_INVALID_ARG, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid. lineSpacing(%d)", lineSpacing);
if (__pCompositeText->GetLineSpace() != lineSpacing)
{
int
TextObject::GetDefaultFontSize(void) const
{
- IF_NOT_CONSTRUCTED(return -1);
-
- return _FontImpl::GetInstance(*__pDefaultFont)->GetSize();
+ return _CoordinateSystemUtils::ConvertToInteger(GetDefaultFontSizeF());
}
float
TextObject::GetDefaultFontSizeF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetDefaultFontSize());
+ IF_NOT_CONSTRUCTED(return -1);
+
+ return _FontImpl::GetInstance(*__pDefaultFont)->GetSizeF();
}
result
TextObject::SetFontSize(int size, int startTextIndex, int textLength)
{
+ return SetFontSize(_CoordinateSystemUtils::ConvertToFloat(size), startTextIndex, textLength);
+}
+
+result
+TextObject::SetFontSize(float size, int startTextIndex, int textLength)
+{
IF_NOT_CONSTRUCTED(return E_INVALID_STATE);
SysTryReturn(NID_GRP
return E_SUCCESS;
}
-result
-TextObject::SetFontSize(float size, int startTextIndex, int textLength)
+int
+TextObject::GetFontSize(int textIndex) const
{
- return SetFontSize(_CoordinateSystemUtils::ConvertToInteger(size),startTextIndex,textLength);
+ return _CoordinateSystemUtils::ConvertToInteger(GetFontSizeF(textIndex));
}
-int
-TextObject::GetFontSize(int textIndex) const
+float
+TextObject::GetFontSizeF(int textIndex) const
{
IF_NOT_CONSTRUCTED(return -1);
, textIndex >= 0
, -1, E_INVALID_ARG, "[E_INVALID_ARG] The argument is invalid.");
- return __pCompositeText->GetFontSize(textIndex);
-}
-
-float
-TextObject::GetFontSizeF(int textIndex) const
-{
- return _CoordinateSystemUtils::ConvertToFloat(GetFontSize(textIndex));
+ return __pCompositeText->GetFontSizeF(textIndex);
}
result
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- x -= (lineBounds.width - lineTextSize.width) / 2;
+ x -= (lineBounds.width - lineTextSize.width) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
break;
}
- x = (x < 0) ? 0 : x;
+ x = (x < 0.0f) ? 0.0f : x;
__pCompositeText->SetWrap(TEXT_OBJECT_WRAP_TYPE_NONE);
int endType = 0;
return -1;
}
- float width = 0;
- float height = 0;
+ float width = 0.0f;
+ float height = 0.0f;
FloatPoint absPoint;
FloatPoint relPoint;
result r = E_SUCCESS;
int textIndex = 0;
int textLength = 0;
- float width = 0;
- float heigth = 0;
+ float width = 0.0f;
+ float heigth = 0.0f;
FloatPoint tempPoint;
r = __pCompositeText->GetCutLinkObjectInfo(cutLinkIndex, textIndex, textLength);
SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
float maxHeight = TextUtility::GetFontMaxHeightF(pFont);
- float posX = 0;
- float posY = 0;
- absX = 0;
- absY = 0;
+ float posX = 0.0f;
+ float posY = 0.0f;
+ absX = 0.0f;
+ absY = 0.0f;
if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE)
{
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (__rect.height - maxHeight) / 2;
+ posY += (__rect.height - maxHeight) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- posX += __rect.width / 2;
+ posX += __rect.width / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (lineHeight - maxHeight) / 2;
+ posY += (lineHeight - maxHeight) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- posX += __rect.width / 2;
+ posX += __rect.width / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
logicalY = posY + __rect.y;
}
- width = 0;
+ width = 0.0f;
height = maxHeight;
absX = posX;
absY = posY;
SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
float maxHeight = TextUtility::GetFontMaxHeightF(pFont);
- float posX = 0;
- float posY = 0;
- absX = 0;
- absY = 0;
+ float posX = 0.0f;
+ float posY = 0.0f;
+ absX = 0.0f;
+ absY = 0.0f;
if (__wrap == TEXT_OBJECT_WRAP_TYPE_NONE)
{
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (__rect.height - maxHeight) / 2;
+ posY += (__rect.height - maxHeight) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- posX += __rect.width / 2;
+ posX += __rect.width / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (lineHeight - maxHeight) / 2;
+ posY += (lineHeight - maxHeight) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
logicalY = posY + __rect.y;
}
- width = 0;
+ width = 0.0f;
height = maxHeight;
absX = posX;
absY = posY;
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- y -= (__rect.height - totalHeight) / 2;
+ y -= (__rect.height - totalHeight) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- x -= (lineBounds.width - lineTextSize.width) / 2;
+ x -= (lineBounds.width - lineTextSize.width) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
break;
}
- if (x < 0)
+ if (x < 0.0f)
{
- x = 0;
+ x = 0.0f;
}
int index = pTextLine->GetTextIndexFromPosition(x, cursorMode);
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- x -= (lineBounds.width - lineTextSize.width) / 2;
+ x -= (lineBounds.width - lineTextSize.width) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- y -= (__rect.height - lineTextSize.height) / 2;
+ y -= (__rect.height - lineTextSize.height) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
break;
}
- if (x < 0)
+ if (x < 0.0f)
{
- x = 0;
+ x = 0.0f;
}
int index = pTextLine->GetTextIndexFromPosition(x, cursorMode);
{
result r = E_SUCCESS;
FloatRectangle lineBounds;
- float firstDisplayPositionY = 0;
+ float firstDisplayPositionY = 0.0f;
int currentTextIndex = textIndex;
int firstDisplayLineIndex = 0;
int lineIndex = 0;
int lineCount = 0;
- float remainingHeight = 0;
+ float remainingHeight = 0.0f;
TextLine* pTextLine = null;
bool isChanged = false;
remainingHeight = __rect.height;
- while ((remainingHeight != 0) && firstDisplayLineIndex < lineCount)
+ while ((remainingHeight != 0.0f) && firstDisplayLineIndex < lineCount)
{
- if (remainingHeight < 0)
+ if (remainingHeight < 0.0f)
{
break;
}
if (lineIndex < firstDisplayLineIndex + displayLineCount)
{
- if (0 < remainingHeight && 0 < firstDisplayLineIndex)
+ if (0.0f < remainingHeight && 0 < firstDisplayLineIndex)
{
pTextLine = __pTextColumn->GetTextLine(firstDisplayLineIndex - 1);
SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
lineBounds = pTextLine->GetBoundsF();
remainingHeight -= lineBounds.height;
- if (remainingHeight < 0)
+ if (remainingHeight < 0.0f)
{
firstDisplayPositionY = lineBounds.y + remainingHeight;
displayLineCount++;
isChanged = true;
}
- else if (remainingHeight < 0 && (lineIndex == firstDisplayLineIndex + displayLineCount - 1))
+ else if (remainingHeight < 0.0f && (lineIndex == firstDisplayLineIndex + displayLineCount - 1))
{
pTextLine = __pTextColumn->GetTextLine(lineIndex);
SysTryReturn(NID_GRP, pTextLine, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
int currentLineIndex = lineIndex - 1;
pTextLine = __pTextColumn->GetTextLine(currentLineIndex);
- while ((pTextLine != null) && 0 < firstDisplayLineIndex && 0 < remainingHeight)
+ while ((pTextLine != null) && 0 < firstDisplayLineIndex && 0.0f < remainingHeight)
{
lineBounds = pTextLine->GetBoundsF();
int currentLineIndex = lineIndex - 1;
pTextLine = __pTextColumn->GetTextLine(currentLineIndex);
- while (pTextLine && 0 < firstDisplayLineIndex && 0 < remainingHeight)
+ while (pTextLine && 0 < firstDisplayLineIndex && 0.0f < remainingHeight)
{
lineBounds = pTextLine->GetBoundsF();
__wrap, lineLength, lineTextSize.width, lineTextSize.height);
lineBounds.height = (lineBounds.height > lineTextSize.height) ? lineBounds.height : lineTextSize.height;
- if (lineBounds.height == 0)
+ if (lineBounds.height == 0.0f)
{
lineBounds.height = TextUtility::GetFontMaxHeightF(pFont);
}
}
else if (lineEndIndex <= currentTextIndex)
{
- float gapWidth = 0;
- float gapHeight = 0;
- float tempWidth = 0;
+ float gapWidth = 0.0f;
+ float gapHeight = 0.0f;
+ float tempWidth = 0.0f;
int textCount = 0;
r = __pCompositeText->GetRegion(lineEndIndex, currentTextIndex - lineEndIndex, gapWidth, gapHeight);
__wrap, lineLength, lineTextSize.width, lineTextSize.height);
lineBounds.height = (lineBounds.height > lineTextSize.height) ? lineBounds.height: lineTextSize.height;
- if (lineBounds.height == 0)
+ if (lineBounds.height == 0.0f)
{
lineBounds.height = TextUtility::GetFontMaxHeightF(pFont);
}
}
__pTextColumn->SetFirstDisplayLineIndex(0);
- __pTextColumn->SetFirstDisplayPositionY(0);
+ __pTextColumn->SetFirstDisplayPositionY(0.0f);
return E_SUCCESS;
}
int lineOffset = 0;
int lineLength = 0;
int textIndexFromLineOffset = 0;
- float lineY = 0;
- float posX = 0;
- float posY = 0;
+ float lineY = 0.0f;
+ float posX = 0.0f;
+ float posY = 0.0f;
_FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- posX += (lineBounds.width - lineTextSize.width) / 2;
+ posX += (lineBounds.width - lineTextSize.width) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (__rect.height - __pTextColumn->GetDisplayHeightF()) / 2;
+ posY += (__rect.height - __pTextColumn->GetDisplayHeightF()) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
break;
}
- if (posX < 0)
+ if (posX < 0.0f)
{
- posX = 0;
+ posX = 0.0f;
}
- if (posY < 0)
+ if (posY < 0.0f)
{
- posY = 0;
+ posY = 0.0f;
}
FloatRectangle textExtent = pTextLine->GetTextExtentF(textIndexFromLineOffset, 1);
if (lineIndex == lineCount)
{
- textExtent.width = 0;
+ textExtent.width = 0.0f;
}
if (textIndex >= 1)
textExtent.height = TextUtility::GetFontMaxHeightF(pTextFont);
}
- if (textExtent.height < 0)
+ if (textExtent.height < 0.0f)
{
textExtent.height = TextUtility::GetFontMaxHeightF(pFont);
}
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- lineY = lineY + (lineBounds.height - textExtent.height) / 2;
+ lineY = lineY + (lineBounds.height - textExtent.height) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
int lineOffset = 0;
int lineLength = 0;
int textIndexFromLineOffset = 0;
- float lineY = 0;
- float posX = 0;
- float posY = 0;
+ float lineY = 0.0f;
+ float posX = 0.0f;
+ float posY = 0.0f;
_FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
textIndexFromLineOffset = textIndex - lineOffset;
}
- Dimension lineTextSize;
+ FloatDimension lineTextSize;
pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
- if (lineTextSize.height == 0)
+ if (lineTextSize.height == 0.0f)
{
- lineTextSize.height = TextUtility::GetFontMaxHeight(pFont);
+ lineTextSize.height = TextUtility::GetFontMaxHeightF(pFont);
}
switch (__align & TEXT_ALIGNMASK_HORIZ)
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- posX += (lineBounds.width - lineTextSize.width) / 2;
+ posX += (lineBounds.width - lineTextSize.width) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (__rect.height - __pTextColumn->GetDisplayHeight()) / 2;
+ posY += (__rect.height - __pTextColumn->GetDisplayHeightF()) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
- posY += (__rect.height - __pTextColumn->GetDisplayHeight());
+ posY += (__rect.height - __pTextColumn->GetDisplayHeightF());
break;
}
- if (posX < 0)
+ if (posX < 0.0f)
{
- posX = 0;
+ posX = 0.0f;
}
- if (posY < 0)
+ if (posY < 0.0f)
{
- posY = 0;
+ posY = 0.0f;
}
FloatRectangle textExtent = pTextLine->GetBlockTextExtentF(textIndexFromLineOffset, 1);
if (lineIndex == lineCount)
{
- textExtent.width = 0;
+ textExtent.width = 0.0f;
}
if (textIndex >= 1)
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- lineY = lineY + (lineBounds.height - textExtent.height) / 2;
+ lineY = lineY + (lineBounds.height - textExtent.height) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
SysTryReturn(NID_GRP, pTextLine, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get text line.");
int lineLength = pTextLine->GetTextLength();
- float posX = 0;
- float posY = 0;
+ float posX = 0.0f;
+ float posY = 0.0f;
_FontImpl* pFont = _FontImpl::GetInstance(*__pDefaultFont);
SysTryReturn(NID_GRP, pFont, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] Fail to get native font instance.");
lineBounds = pTextLine->GetBoundsF();
pTextLine->GetRegion(0, lineLength, lineTextSize.width, lineTextSize.height);
- if (lineTextSize.height == 0 || pTextLine->GetTextLength() == 0)
+ if (lineTextSize.height == 0.0f || pTextLine->GetTextLength() == 0.0f)
{
lineTextSize.height = TextUtility::GetFontMaxHeightF(pFont);
}
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- posX += (lineBounds.width - lineTextSize.width) / 2;
+ posX += (lineBounds.width - lineTextSize.width) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT:
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY += (__rect.height - lineTextSize.height) / 2;
+ posY += (__rect.height - lineTextSize.height) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
break;
}
- posX = (posX < 0) ? 0 : posX;
- posY = (posY < 0) ? 0 : posY;
+ posX = (posX < 0.0f) ? 0.0f : posX;
+ posY = (posY < 0.0f) ? 0.0f : posY;
FloatRectangle textExtent = pTextLine->GetTextExtentF(textIndex - pTextLine->GetTextOffset(), 1);
textExtent.height = TextUtility::GetFontMaxHeightF(pTextFont);
}
- if (textExtent.height < 0)
+ if (textExtent.height < 0.0f)
{
textExtent.height = TextUtility::GetFontMaxHeightF(pFont);
}
break;
case TEXT_OBJECT_ALIGNMENT_MIDDLE:
- posY = posY + (lineBounds.height - textExtent.height) / 2;
+ posY = posY + (lineBounds.height - textExtent.height) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_BOTTOM:
}
absX = posX + textExtent.x;
- logicalX = (absX >= 0) ? absX + __rect.x : absX;
+ logicalX = (absX >= 0.0f) ? absX + __rect.x : absX;
absY = posY;
logicalY = absY + __rect.y;
width = textExtent.width;
int
TextObject::GetTotalComposedHeight(void) const
{
- return __pCompositeText->GetTotalComposedHeight();
+ return _CoordinateSystemUtils::ConvertToInteger(GetTotalComposedHeightF());
}
float
TextObject::GetTotalComposedHeightF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetTotalComposedHeight());
+ return __pCompositeText->GetTotalComposedHeightF();
}
int
{
IF_NOT_CONSTRUCTED(return -1);
- float height = 0;
+ float height = 0.0f;
if (IsPartialComposingModeEnabled())
{
height = __pCompositeText->GetAnalysedTotalHeightF();
Rectangle
TextObject::GetBounds(void) const
{
- IF_NOT_CONSTRUCTED(return Rectangle(0,0,0,0));
+ IF_NOT_CONSTRUCTED(return Rectangle(0, 0, 0, 0));
return _CoordinateSystemUtils::ConvertToInteger(__rect);
}
FloatRectangle
TextObject::GetBoundsF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetBounds());
+ return __rect;
}
int
{
IF_NOT_CONSTRUCTED(return -1);
- return __pCompositeText->GetLineSpace();
+ return _CoordinateSystemUtils::ConvertToInteger(GetLineSpaceF());
}
float
TextObject::GetLineSpaceF(void) const
{
- return _CoordinateSystemUtils::ConvertToFloat(GetLineSpace());
+ IF_NOT_CONSTRUCTED(return -1);
+
+ return __pCompositeText->GetLineSpaceF();
}
int
break;
case TEXT_OBJECT_ALIGNMENT_CENTER:
- extentDim.width += (lineBounds.width - lineTextSize.width) / 2;
+ extentDim.width += (lineBounds.width - lineTextSize.width) / 2.0f;
break;
case TEXT_OBJECT_ALIGNMENT_RIGHT: