Skip to content

Commit

Permalink
Remove the vertical alignment property from TextLayer. (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
domchen authored Nov 8, 2024
1 parent d5f31fe commit 87f78fa
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 71 deletions.
19 changes: 2 additions & 17 deletions include/tgfx/layers/TextLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "tgfx/core/Font.h"
#include "tgfx/layers/Layer.h"
#include "tgfx/layers/TextAlign.h"
#include "tgfx/layers/VerticalAlign.h"

namespace tgfx {
/**
Expand Down Expand Up @@ -93,8 +92,8 @@ class TextLayer : public Layer {
void setWidth(float width);

/**
* Returns the layout height of the text, used for vertical alignment. The default value is 0,
* meaning the text will be rendered without any vertical alignment.
* Returns the layout height of the text. Any text that exceeds this height will be truncated (not
* displayed). The default value is 0, meaning the text will be rendered without any truncation.
*/
float height() const {
return _height;
Expand All @@ -118,19 +117,6 @@ class TextLayer : public Layer {
*/
void setTextAlign(TextAlign align);

/**
* Specifies how the text should be vertically aligned within the layout height. The default is
* VerticalAlign::Top. This setting is ignored if the layout height is 0.
*/
VerticalAlign verticalAlign() const {
return _verticalAlign;
}

/**
* Sets how the text should be vertically aligned within the layout height.
*/
void setVerticalAlign(VerticalAlign align);

/**
* Returns whether the text should be wrapped to fit within the text width. The default value is
* false. This setting is ignored if the layout width is 0.
Expand All @@ -156,7 +142,6 @@ class TextLayer : public Layer {
float _width = 0;
float _height = 0;
TextAlign _textAlign = TextAlign::Left;
VerticalAlign _verticalAlign = VerticalAlign::Top;
bool _autoWrap = false;

std::string preprocessNewLines(const std::string& text);
Expand Down
46 changes: 0 additions & 46 deletions include/tgfx/layers/VerticalAlign.h

This file was deleted.

8 changes: 0 additions & 8 deletions src/layers/TextLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,6 @@ void TextLayer::setTextAlign(TextAlign align) {
invalidateContent();
}

void TextLayer::setVerticalAlign(VerticalAlign value) {
if (_verticalAlign == value) {
return;
}
_verticalAlign = value;
invalidateContent();
}

void TextLayer::setAutoWrap(bool value) {
if (_autoWrap == value) {
return;
Expand Down

0 comments on commit 87f78fa

Please sign in to comment.