diff options
author | Kostadin Damyanov <maxmight@gmail.com> | 2016-01-15 22:43:54 +0200 |
---|---|---|
committer | Kostadin Damyanov <maxmight@gmail.com> | 2016-01-15 22:43:54 +0200 |
commit | 7998197ff17892a8127aa2fe53d13937763dee87 (patch) | |
tree | 53c97bf9907a3225776340273e773a4d904cbb73 /scene/gui/button.cpp | |
parent | 62574759ab16043b70f2da6e160072c353ba4148 (diff) | |
parent | 3c6dd5749d445f082fc925a34cc0a26f8d342304 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'scene/gui/button.cpp')
-rw-r--r-- | scene/gui/button.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index edeb18bfc1..b9ce46d738 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -137,8 +137,10 @@ void Button::_notification(int p_what) { text_ofs.y+=font->get_ascent(); font->draw( ci, text_ofs.floor(), text, color,clip_text?text_clip:-1); if (!_icon.is_null()) { + + int valign = size.height-style->get_minimum_size().y; - _icon->draw(ci,Point2(style->get_offset().x, Math::floor( (size.height-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) ); + _icon->draw(ci,style->get_offset()+Point2(0, Math::floor( (valign-_icon->get_height())/2.0 ) ),is_disabled()?Color(1,1,1,0.4):Color(1,1,1) ); } |