summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/button.cpp8
-rw-r--r--scene/gui/range.cpp1
-rw-r--r--scene/gui/text_edit.cpp2
-rw-r--r--scene/gui/tree.cpp1
4 files changed, 7 insertions, 5 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index 6b3e89af6c..ca4c255855 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -174,17 +174,17 @@ void Button::_notification(int p_what) {
_size.width -= get_constant("hseparation") + icon_ofs_region;
if (!clip_text)
_size.width -= get_font("font")->get_string_size(xl_text).width;
- float icon_width = icon->get_width() * _size.height / icon->get_height();
+ float icon_width = _icon->get_width() * _size.height / _icon->get_height();
float icon_height = _size.height;
if (icon_width > _size.width) {
icon_width = _size.width;
- icon_height = icon->get_height() * icon_width / icon->get_width();
+ icon_height = _icon->get_height() * icon_width / _icon->get_width();
}
icon_region = Rect2(style->get_offset() + Point2(icon_ofs_region, (_size.height - icon_height) / 2), Size2(icon_width, icon_height));
} else {
- icon_region = Rect2(style->get_offset() + Point2(icon_ofs_region, Math::floor((valign - _icon->get_height()) / 2.0)), icon->get_size());
+ icon_region = Rect2(style->get_offset() + Point2(icon_ofs_region, Math::floor((valign - _icon->get_height()) / 2.0)), _icon->get_size());
}
}
@@ -221,7 +221,7 @@ void Button::_notification(int p_what) {
font->draw(ci, text_ofs.floor(), xl_text, color, clip_text ? text_clip : -1);
if (!_icon.is_null() && icon_region.size.width > 0) {
- draw_texture_rect_region(_icon, icon_region, Rect2(Point2(), icon->get_size()), color_icon);
+ draw_texture_rect_region(_icon, icon_region, Rect2(Point2(), _icon->get_size()), color_icon);
}
} break;
}
diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp
index ed5dd77f53..9c016b5a50 100644
--- a/scene/gui/range.cpp
+++ b/scene/gui/range.cpp
@@ -213,6 +213,7 @@ void Range::unshare() {
nshared->val = shared->val;
nshared->step = shared->step;
nshared->page = shared->page;
+ nshared->exp_ratio = shared->exp_ratio;
nshared->allow_greater = shared->allow_greater;
nshared->allow_lesser = shared->allow_lesser;
_unref_shared();
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index c818633f48..8ddc31745e 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -4585,7 +4585,7 @@ void TextEdit::_scroll_moved(double p_to_val) {
int v_scroll_i = floor(get_v_scroll());
int sc = 0;
int n_line;
- for (n_line = 0; n_line < text.size() - 1; n_line++) {
+ for (n_line = 0; n_line < text.size(); n_line++) {
if (!is_line_hidden(n_line)) {
sc++;
sc += times_line_wraps(n_line);
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 2c38676c83..a44b42a467 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -4049,6 +4049,7 @@ Tree::Tree() {
drop_mode_section = 0;
single_select_defer = NULL;
+ scrolling = false;
allow_rmb_select = false;
force_edit_checkbox_only_on_checkbox = false;