Skip to content

Commit

Permalink
GRAPHICS: Rename align to horizontal alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
farmboy0 committed Nov 24, 2017
1 parent f5ee241 commit 3d519cd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/graphics/aurora/highlightabletext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ namespace Graphics {

namespace Aurora {

HighlightableText::HighlightableText(const FontHandle &font, const Common::UString &str, float r, float g, float b, float a, float align) :
Text(font, str, r, g, b, a, align) {
HighlightableText::HighlightableText(const FontHandle &font, const Common::UString &str, float r, float g, float b, float a, float halign) :
Text(font, str, r, g, b, a, halign) {
}

HighlightableText::~HighlightableText() {
Expand Down
2 changes: 1 addition & 1 deletion src/graphics/aurora/highlightabletext.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class HighlightableText: public Text, public Highlightable {

public:
HighlightableText(const FontHandle &font, const Common::UString &str,
float r = 1.0f, float g = 1.0f, float b = 1.0f, float a = 1.0f, float align = 0.0f);
float r = 1.0f, float g = 1.0f, float b = 1.0f, float a = 1.0f, float halign = 0.0f);
~HighlightableText();

void render(RenderPass pass);
Expand Down
12 changes: 6 additions & 6 deletions src/graphics/aurora/text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ namespace Graphics {
namespace Aurora {

Text::Text(const FontHandle &font, const Common::UString &str,
float r, float g, float b, float a, float align) :
float r, float g, float b, float a, float halign) :
Graphics::GUIElement(Graphics::GUIElement::kGUIElementFront),
_r(r), _g(g), _b(b), _a(a), _font(font), _x(0.0f), _y(0.0f), _align(align),
_r(r), _g(g), _b(b), _a(a), _font(font), _x(0.0f), _y(0.0f), _halign(halign),
_disableColorTokens(false) {

set(str);
Expand Down Expand Up @@ -94,8 +94,8 @@ void Text::unsetColor() {
setColor(1.0f, 1.0f, 1.0f, 1.0f);
}

void Text::setAlign(float align) {
_align = align;
void Text::setHorizontalAlign(float halign) {
_halign = halign;
}

const Common::UString &Text::get() const {
Expand Down Expand Up @@ -284,8 +284,8 @@ void Text::drawLine(const Common::UString &line, float maxLength,

Font &font = _font.getFont();

// Align
glTranslatef(roundf((maxLength - font.getLineWidth(line)) * _align), 0.0f, 0.0f);
// Horizontal Align
glTranslatef(roundf((maxLength - font.getLineWidth(line)) * _halign), 0.0f, 0.0f);

// Draw line
for (Common::UString::iterator s = line.begin(); s != line.end(); ++s, position++) {
Expand Down
6 changes: 3 additions & 3 deletions src/graphics/aurora/text.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace Aurora {
class Text : public GUIElement {
public:
Text(const FontHandle &font, const Common::UString &str,
float r = 1.0f, float g = 1.0f, float b = 1.0f, float a = 1.0f, float align = 0.0f);
float r = 1.0f, float g = 1.0f, float b = 1.0f, float a = 1.0f, float halign = 0.0f);
~Text();

const Common::UString &get() const;
Expand All @@ -52,7 +52,7 @@ class Text : public GUIElement {
void setPosition(float x, float y, float z = -FLT_MAX);
void setColor(float r, float g, float b, float a);
void unsetColor();
void setAlign(float align);
void setHorizontalAlign(float halign);

/** Change the font of the text. */
void setFont(const Common::UString &fnt);
Expand Down Expand Up @@ -84,7 +84,7 @@ class Text : public GUIElement {
float _width;
float _height;

float _align;
float _halign;

Common::UString _str;
ColorPositions _colors;
Expand Down

0 comments on commit 3d519cd

Please sign in to comment.