diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2017-03-05 16:44:50 +0100 |
commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /scene/gui/label.h | |
parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) | |
download | redot-engine-5dbf1809c6e3e905b94b8764e99491e608122261.tar.gz |
A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?
I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon
A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format
A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
Diffstat (limited to 'scene/gui/label.h')
-rw-r--r-- | scene/gui/label.h | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/scene/gui/label.h b/scene/gui/label.h index 80e4c970f6..769e4b2256 100644 --- a/scene/gui/label.h +++ b/scene/gui/label.h @@ -35,9 +35,9 @@ */ class Label : public Control { - GDCLASS( Label, Control ); -public: + GDCLASS(Label, Control); +public: enum Align { ALIGN_LEFT, @@ -70,15 +70,21 @@ private: struct WordCache { enum { - CHAR_NEWLINE=-1, - CHAR_WRAPLINE=-2 + CHAR_NEWLINE = -1, + CHAR_WRAPLINE = -2 }; int char_pos; // if -1, then newline int word_len; int pixel_width; int space_count; WordCache *next; - WordCache() { char_pos=0; word_len=0; pixel_width=0; next=0; space_count=0;} + WordCache() { + char_pos = 0; + word_len = 0; + pixel_width = 0; + next = 0; + space_count = 0; + } }; bool word_cache_dirty; @@ -91,13 +97,13 @@ private: int visible_chars; int lines_skipped; int max_lines_visible; + protected: void _notification(int p_what); static void _bind_methods(); // bind helpers public: - virtual Size2 get_minimum_size() const; void set_align(Align p_align); @@ -106,7 +112,7 @@ public: void set_valign(VAlign p_align); VAlign get_valign() const; - void set_text(const String& p_string); + void set_text(const String &p_string); String get_text() const; void set_autowrap(bool p_autowrap); @@ -135,13 +141,11 @@ public: int get_line_count() const; int get_visible_line_count() const; - Label(const String& p_text=String()); + Label(const String &p_text = String()); ~Label(); - }; - -VARIANT_ENUM_CAST( Label::Align ); -VARIANT_ENUM_CAST( Label::VAlign ); +VARIANT_ENUM_CAST(Label::Align); +VARIANT_ENUM_CAST(Label::VAlign); #endif |