diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/dialogs.cpp | 2 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 1 | ||||
-rw-r--r-- | scene/main/http_request.cpp | 16 | ||||
-rw-r--r-- | scene/main/http_request.h | 3 | ||||
-rw-r--r-- | scene/resources/material.h | 2 | ||||
-rw-r--r-- | scene/resources/style_box.cpp | 21 | ||||
-rw-r--r-- | scene/resources/style_box.h | 3 |
7 files changed, 46 insertions, 2 deletions
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index a1b584bad6..b6e647d1af 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -161,7 +161,7 @@ void WindowDialog::_gui_input(const Ref<InputEvent> &p_event) { global_pos.y = MAX(global_pos.y, 0); // Ensure title bar stays visible. Rect2 rect = get_rect(); - Size2 min_size = get_minimum_size(); + Size2 min_size = get_combined_minimum_size(); if (drag_type == DRAG_MOVE) { rect.position = global_pos - drag_offset; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 8ddc31745e..b997d7a064 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4593,6 +4593,7 @@ void TextEdit::_scroll_moved(double p_to_val) { break; } } + n_line = MIN(n_line, text.size() - 1); int line_wrap_amount = times_line_wraps(n_line); int wi = line_wrap_amount - (sc - v_scroll_i - 1); wi = CLAMP(wi, 0, line_wrap_amount); diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 6c922adbd2..0ae330b2ed 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -457,6 +457,18 @@ String HTTPRequest::get_download_file() const { return download_to_file; } + +void HTTPRequest::set_download_chunk_size(int p_chunk_size) { + + ERR_FAIL_COND(get_http_client_status() != HTTPClient::STATUS_DISCONNECTED); + + client->set_read_chunk_size(p_chunk_size); +} + +int HTTPRequest::get_download_chunk_size() const { + return client->get_read_chunk_size(); +} + HTTPClient::Status HTTPRequest::get_http_client_status() const { return client->get_status(); } @@ -524,9 +536,13 @@ void HTTPRequest::_bind_methods() { ClassDB::bind_method(D_METHOD("set_timeout", "timeout"), &HTTPRequest::set_timeout); ClassDB::bind_method(D_METHOD("get_timeout"), &HTTPRequest::get_timeout); + ClassDB::bind_method(D_METHOD("set_download_chunk_size"), &HTTPRequest::set_download_chunk_size); + ClassDB::bind_method(D_METHOD("get_download_chunk_size"), &HTTPRequest::get_download_chunk_size); + ClassDB::bind_method(D_METHOD("_timeout"), &HTTPRequest::_timeout); ADD_PROPERTY(PropertyInfo(Variant::STRING, "download_file", PROPERTY_HINT_FILE), "set_download_file", "get_download_file"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "download_chunk_size", PROPERTY_HINT_RANGE, "256,16777216"), "set_download_chunk_size", "get_download_chunk_size"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_threads"), "set_use_threads", "is_using_threads"); ADD_PROPERTY(PropertyInfo(Variant::INT, "body_size_limit", PROPERTY_HINT_RANGE, "-1,2000000000"), "set_body_size_limit", "get_body_size_limit"); ADD_PROPERTY(PropertyInfo(Variant::INT, "max_redirects", PROPERTY_HINT_RANGE, "-1,64"), "set_max_redirects", "get_max_redirects"); diff --git a/scene/main/http_request.h b/scene/main/http_request.h index f1f91235a6..fa01172d9f 100644 --- a/scene/main/http_request.h +++ b/scene/main/http_request.h @@ -126,6 +126,9 @@ public: void set_download_file(const String &p_file); String get_download_file() const; + void set_download_chunk_size(int p_chunk_size); + int get_download_chunk_size() const; + void set_body_size_limit(int p_bytes); int get_body_size_limit() const; diff --git a/scene/resources/material.h b/scene/resources/material.h index 1c69a754b6..11f8f20cf3 100644 --- a/scene/resources/material.h +++ b/scene/resources/material.h @@ -252,7 +252,7 @@ private: uint64_t flags : 18; uint64_t detail_blend_mode : 2; uint64_t diffuse_mode : 3; - uint64_t specular_mode : 2; + uint64_t specular_mode : 3; uint64_t invalid_key : 1; uint64_t deep_parallax : 1; uint64_t billboard_mode : 2; diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp index d56360f918..f26b57b572 100644 --- a/scene/resources/style_box.cpp +++ b/scene/resources/style_box.cpp @@ -81,6 +81,10 @@ Size2 StyleBox::get_center_size() const { return Size2(); } +Rect2 StyleBox::get_draw_rect(const Rect2 &p_rect) const { + return p_rect; +} + void StyleBox::_bind_methods() { ClassDB::bind_method(D_METHOD("test_mask", "point", "rect"), &StyleBox::test_mask); @@ -175,6 +179,10 @@ float StyleBoxTexture::get_style_margin(Margin p_margin) const { return margin[p_margin]; } +Rect2 StyleBoxTexture::get_draw_rect(const Rect2 &p_rect) const { + return p_rect.grow_individual(expand_margin[MARGIN_LEFT], expand_margin[MARGIN_TOP], expand_margin[MARGIN_RIGHT], expand_margin[MARGIN_BOTTOM]); +} + void StyleBoxTexture::draw(RID p_canvas_item, const Rect2 &p_rect) const { if (texture.is_null()) return; @@ -685,6 +693,19 @@ inline void adapt_values(int p_index_a, int p_index_b, int *adapted_values, cons adapted_values[p_index_a] = MIN(p_max_a, adapted_values[p_index_a]); adapted_values[p_index_b] = MIN(p_max_b, adapted_values[p_index_b]); } + +Rect2 StyleBoxFlat::get_draw_rect(const Rect2 &p_rect) const { + Rect2 draw_rect = p_rect.grow_individual(expand_margin[MARGIN_LEFT], expand_margin[MARGIN_TOP], expand_margin[MARGIN_RIGHT], expand_margin[MARGIN_BOTTOM]); + + if (shadow_size > 0) { + Rect2 shadow_rect = draw_rect.grow(shadow_size); + shadow_rect.position += shadow_offset; + draw_rect = draw_rect.merge(shadow_rect); + } + + return draw_rect; +} + void StyleBoxFlat::draw(RID p_canvas_item, const Rect2 &p_rect) const { //PREPARATIONS diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h index d02e107480..ec07b5e885 100644 --- a/scene/resources/style_box.h +++ b/scene/resources/style_box.h @@ -56,6 +56,7 @@ public: float get_margin(Margin p_margin) const; virtual Size2 get_center_size() const; + virtual Rect2 get_draw_rect(const Rect2 &p_rect) const; virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const = 0; CanvasItem *get_current_item_drawn() const; @@ -133,6 +134,7 @@ public: void set_modulate(const Color &p_modulate); Color get_modulate() const; + virtual Rect2 get_draw_rect(const Rect2 &p_rect) const; virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const; StyleBoxTexture(); @@ -227,6 +229,7 @@ public: virtual Size2 get_center_size() const; + virtual Rect2 get_draw_rect(const Rect2 &p_rect) const; virtual void draw(RID p_canvas_item, const Rect2 &p_rect) const; StyleBoxFlat(); |