diff options
| author | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
|---|---|---|
| committer | Rémi Verschelde | 2017-03-05 16:44:50 +0100 |
| commit | 5dbf1809c6e3e905b94b8764e99491e608122261 (patch) | |
| tree | 5e5a5360db15d86d59ec8c6e4f7eb511388c5a9a /scene/gui/separator.cpp | |
| parent | 45438e9918d421b244bfd7776a30e67dc7f2d3e3 (diff) | |
| download | godot-5dbf180.tar.gz godot-5dbf180.tar.zst godot-5dbf180.zip | |
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/separator.cpp')
| -rw-r--r-- | scene/gui/separator.cpp | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/scene/gui/separator.cpp b/scene/gui/separator.cpp index 32bd2239f..e256b8f92 100644 --- a/scene/gui/separator.cpp +++ b/scene/gui/separator.cpp @@ -28,54 +28,47 @@ /*************************************************************************/ #include "separator.h" - Size2 Separator::get_minimum_size() const { - Size2 ms(3,3); - ms[orientation]=get_constant("separation"); + Size2 ms(3, 3); + ms[orientation] = get_constant("separation"); return ms; - - } void Separator::_notification(int p_what) { - - switch(p_what) { + switch (p_what) { case NOTIFICATION_DRAW: { Size2i size = get_size(); Ref<StyleBox> style = get_stylebox("separator"); - Size2i ssize=style->get_minimum_size()+style->get_center_size(); + Size2i ssize = style->get_minimum_size() + style->get_center_size(); - if (orientation==VERTICAL) { + if (orientation == VERTICAL) { - style->draw(get_canvas_item(),Rect2( (size.x-ssize.x)/2,0,ssize.x,size.y )); + style->draw(get_canvas_item(), Rect2((size.x - ssize.x) / 2, 0, ssize.x, size.y)); } else { - style->draw(get_canvas_item(),Rect2( 0,(size.y-ssize.y)/2,size.x,ssize.y )); + style->draw(get_canvas_item(), Rect2(0, (size.y - ssize.y) / 2, size.x, ssize.y)); } } break; } } -Separator::Separator() -{ +Separator::Separator() { } - -Separator::~Separator() -{ +Separator::~Separator() { } HSeparator::HSeparator() { - orientation=HORIZONTAL; + orientation = HORIZONTAL; } VSeparator::VSeparator() { - orientation=VERTICAL; + orientation = VERTICAL; } |
