feat: updated engine version to 4.4-rc1

This commit is contained in:
Sara 2025-02-23 14:38:14 +01:00
parent ee00efde1f
commit 21ba8e33af
5459 changed files with 1128836 additions and 198305 deletions

View file

@ -30,9 +30,6 @@
#include "scroll_bar.h"
#include "core/os/keyboard.h"
#include "core/os/os.h"
#include "core/string/print_string.h"
#include "scene/main/window.h"
#include "scene/theme/theme_db.h"
@ -93,7 +90,7 @@ void ScrollBar::gui_input(const Ref<InputEvent> &p_event) {
return;
}
ofs -= decr_size;
ofs -= decr_size + theme_cache.scroll_style->get_margin(orientation == VERTICAL ? SIDE_TOP : SIDE_LEFT);
if (ofs < grabber_ofs) {
if (scrolling) {
@ -151,7 +148,7 @@ void ScrollBar::gui_input(const Ref<InputEvent> &p_event) {
Ref<Texture2D> decr = theme_cache.decrement_icon;
double decr_size = orientation == VERTICAL ? decr->get_height() : decr->get_width();
ofs -= decr_size;
ofs -= decr_size + theme_cache.scroll_style->get_margin(orientation == VERTICAL ? SIDE_TOP : SIDE_LEFT);
double diff = (ofs - drag.pos_at_click) / get_area_size();
@ -248,8 +245,6 @@ void ScrollBar::_notification(int p_what) {
incr = theme_cache.increment_icon;
}
Ref<StyleBox> bg = has_focus() ? theme_cache.scroll_focus_style : theme_cache.scroll_style;
Ref<StyleBox> grabber;
if (drag.active) {
grabber = theme_cache.grabber_pressed_style;
@ -277,7 +272,11 @@ void ScrollBar::_notification(int p_what) {
area.height -= incr->get_height() + decr->get_height();
}
bg->draw(ci, Rect2(ofs, area));
if (has_focus()) {
theme_cache.scroll_focus_style->draw(ci, Rect2(ofs, area));
} else {
theme_cache.scroll_style->draw(ci, Rect2(ofs, area));
}
if (orientation == HORIZONTAL) {
ofs.width += area.width;
@ -292,11 +291,11 @@ void ScrollBar::_notification(int p_what) {
grabber_rect.size.width = get_grabber_size();
grabber_rect.size.height = get_size().height;
grabber_rect.position.y = 0;
grabber_rect.position.x = get_grabber_offset() + decr->get_width() + bg->get_margin(SIDE_LEFT);
grabber_rect.position.x = get_grabber_offset() + decr->get_width() + theme_cache.scroll_style->get_margin(SIDE_LEFT);
} else {
grabber_rect.size.width = get_size().width;
grabber_rect.size.height = get_grabber_size();
grabber_rect.position.y = get_grabber_offset() + decr->get_height() + bg->get_margin(SIDE_TOP);
grabber_rect.position.y = get_grabber_offset() + decr->get_height() + theme_cache.scroll_style->get_margin(SIDE_TOP);
grabber_rect.position.x = 0;
}
@ -472,7 +471,7 @@ double ScrollBar::get_area_size() const {
}
double ScrollBar::get_grabber_offset() const {
return (get_area_size()) * get_as_ratio();
return get_area_size() * get_as_ratio();
}
Size2 ScrollBar::get_minimum_size() const {