From deec700497f860602a26cf16904e44a23cc722ce Mon Sep 17 00:00:00 2001 From: Ken Paulson Date: Mon, 5 Aug 2019 22:17:57 -0400 Subject: [PATCH] Implemented check_vadjust in CheckBox & CheckButton. It was exposed to the editor, but wasn't used. --- doc/classes/CheckBox.xml | 1 + doc/classes/CheckButton.xml | 1 + scene/gui/check_box.cpp | 2 +- scene/gui/check_button.cpp | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 80b5e907174..93c42a85a34 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -14,6 +14,7 @@ + The vertical offset used when rendering the check icons. diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index f4d0e0657b1..4744894fc16 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -14,6 +14,7 @@ + The vertical offset used when rendering the icons. diff --git a/scene/gui/check_box.cpp b/scene/gui/check_box.cpp index 1d8b74d9db2..87444077638 100644 --- a/scene/gui/check_box.cpp +++ b/scene/gui/check_box.cpp @@ -79,7 +79,7 @@ void CheckBox::_notification(int p_what) { Vector2 ofs; ofs.x = sb->get_margin(MARGIN_LEFT); - ofs.y = int((get_size().height - get_icon_size().height) / 2); + ofs.y = int((get_size().height - get_icon_size().height) / 2) + get_constant("check_vadjust"); if (is_pressed()) on->draw(ci, ofs); diff --git a/scene/gui/check_button.cpp b/scene/gui/check_button.cpp index a2d0f388c44..f47547f2cc5 100644 --- a/scene/gui/check_button.cpp +++ b/scene/gui/check_button.cpp @@ -76,7 +76,7 @@ void CheckButton::_notification(int p_what) { Size2 tex_size = get_icon_size(); ofs.x = get_size().width - (tex_size.width + sb->get_margin(MARGIN_RIGHT)); - ofs.y = (get_size().height - tex_size.height) / 2; + ofs.y = (get_size().height - tex_size.height) / 2 + get_constant("check_vadjust"); if (is_pressed()) on->draw(ci, ofs);