summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/3d/immediate_geometry.h2
-rw-r--r--scene/gui/tab_container.cpp4
-rw-r--r--scene/gui/text_edit.cpp3
-rw-r--r--scene/resources/environment.cpp21
-rw-r--r--scene/resources/environment.h6
5 files changed, 17 insertions, 19 deletions
diff --git a/scene/3d/immediate_geometry.h b/scene/3d/immediate_geometry.h
index 6db825bf54..93ef726c6d 100644
--- a/scene/3d/immediate_geometry.h
+++ b/scene/3d/immediate_geometry.h
@@ -38,7 +38,7 @@ class ImmediateGeometry : public GeometryInstance {
GDCLASS(ImmediateGeometry, GeometryInstance);
RID im;
- //a list of texures drawn need to be kept, to avoid references
+ //a list of textures drawn need to be kept, to avoid references
// in VisualServer from becoming invalid if the texture is no longer used
List<Ref<Texture> > cached_textures;
bool empty;
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp
index 80e12e9580..6e50614e8f 100644
--- a/scene/gui/tab_container.cpp
+++ b/scene/gui/tab_container.cpp
@@ -264,9 +264,9 @@ void TabContainer::_notification(int p_what) {
if (popup) {
x -= menu->get_width();
if (mouse_x_cache > x)
- menu_hl->draw(get_canvas_item(), Size2(x, 0));
+ menu_hl->draw(get_canvas_item(), Size2(x, (header_height - menu_hl->get_height()) / 2));
else
- menu->draw(get_canvas_item(), Size2(x, 0));
+ menu->draw(get_canvas_item(), Size2(x, (header_height - menu->get_height()) / 2));
}
// Draw the navigation buttons.
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index d79ce25344..11bdbfc3e8 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -501,8 +501,7 @@ void TextEdit::_notification(int p_what) {
if (cache.background_color.a > 0.01) {
- Point2i ofs = Point2i(cache.style_normal->get_offset()) / 2.0;
- VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(ofs, get_size() - cache.style_normal->get_minimum_size() + ofs), cache.background_color);
+ VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2i(), get_size()), cache.background_color);
}
//compute actual region to start (may be inside say, a comment).
//slow in very large documments :( but ok for source!
diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp
index da3bc6a95b..4c6fa7c8a1 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -55,12 +55,11 @@ void Environment::set_sky(const Ref<Sky> &p_sky) {
VS::get_singleton()->environment_set_sky(environment, sb_rid);
}
-void Environment::set_sky_scale(float p_scale) {
+void Environment::set_sky_custom_fov(float p_scale) {
- bg_sky_scale = p_scale;
- VS::get_singleton()->environment_set_sky_scale(environment, p_scale);
+ bg_sky_custom_fov = p_scale;
+ VS::get_singleton()->environment_set_sky_custom_fov(environment, p_scale);
}
-
void Environment::set_bg_color(const Color &p_color) {
bg_color = p_color;
@@ -101,9 +100,9 @@ Ref<Sky> Environment::get_sky() const {
return bg_sky;
}
-float Environment::get_sky_scale() const {
+float Environment::get_sky_custom_fov() const {
- return bg_sky_scale;
+ return bg_sky_custom_fov;
}
Color Environment::get_bg_color() const {
@@ -268,7 +267,7 @@ Ref<Texture> Environment::get_adjustment_color_correction() const {
void Environment::_validate_property(PropertyInfo &property) const {
- if (property.name == "background_sky" || property.name == "background_sky_scale" || property.name == "ambient_light/sky_contribution") {
+ if (property.name == "background_sky" || property.name == "background_sky_custom_fov" || property.name == "ambient_light/sky_contribution") {
if (bg_mode != BG_SKY && bg_mode != BG_COLOR_SKY) {
property.usage = PROPERTY_USAGE_NOEDITOR;
}
@@ -820,7 +819,7 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_background", "mode"), &Environment::set_background);
ClassDB::bind_method(D_METHOD("set_sky", "sky"), &Environment::set_sky);
- ClassDB::bind_method(D_METHOD("set_sky_scale", "scale"), &Environment::set_sky_scale);
+ ClassDB::bind_method(D_METHOD("set_sky_custom_fov", "scale"), &Environment::set_sky_custom_fov);
ClassDB::bind_method(D_METHOD("set_bg_color", "color"), &Environment::set_bg_color);
ClassDB::bind_method(D_METHOD("set_bg_energy", "energy"), &Environment::set_bg_energy);
ClassDB::bind_method(D_METHOD("set_canvas_max_layer", "layer"), &Environment::set_canvas_max_layer);
@@ -830,7 +829,7 @@ void Environment::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_background"), &Environment::get_background);
ClassDB::bind_method(D_METHOD("get_sky"), &Environment::get_sky);
- ClassDB::bind_method(D_METHOD("get_sky_scale"), &Environment::get_sky_scale);
+ ClassDB::bind_method(D_METHOD("get_sky_custom_fov"), &Environment::get_sky_custom_fov);
ClassDB::bind_method(D_METHOD("get_bg_color"), &Environment::get_bg_color);
ClassDB::bind_method(D_METHOD("get_bg_energy"), &Environment::get_bg_energy);
ClassDB::bind_method(D_METHOD("get_canvas_max_layer"), &Environment::get_canvas_max_layer);
@@ -841,7 +840,7 @@ void Environment::_bind_methods() {
ADD_GROUP("Background", "background_");
ADD_PROPERTY(PropertyInfo(Variant::INT, "background_mode", PROPERTY_HINT_ENUM, "Clear Color,Custom Color,Sky,Color+Sky,Canvas,Keep"), "set_background", "get_background");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "background_sky", PROPERTY_HINT_RESOURCE_TYPE, "Sky"), "set_sky", "get_sky");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "background_sky_scale", PROPERTY_HINT_RANGE, "0,32,0.01"), "set_sky_scale", "get_sky_scale");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "background_sky_custom_fov", PROPERTY_HINT_RANGE, "0,180,0.1"), "set_sky_custom_fov", "get_sky_custom_fov");
ADD_PROPERTY(PropertyInfo(Variant::COLOR, "background_color"), "set_bg_color", "get_bg_color");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "background_energy", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_bg_energy", "get_bg_energy");
ADD_PROPERTY(PropertyInfo(Variant::INT, "background_canvas_max_layer", PROPERTY_HINT_RANGE, "-1000,1000,1"), "set_canvas_max_layer", "get_canvas_max_layer");
@@ -1142,7 +1141,7 @@ Environment::Environment() {
environment = VS::get_singleton()->environment_create();
bg_mode = BG_CLEAR_COLOR;
- bg_sky_scale = 1.0;
+ bg_sky_custom_fov = 0;
bg_energy = 1.0;
bg_canvas_max_layer = 0;
ambient_energy = 1.0;
diff --git a/scene/resources/environment.h b/scene/resources/environment.h
index 9046ec1e49..5909846074 100644
--- a/scene/resources/environment.h
+++ b/scene/resources/environment.h
@@ -76,7 +76,7 @@ private:
BGMode bg_mode;
Ref<Sky> bg_sky;
- float bg_sky_scale;
+ float bg_sky_custom_fov;
Color bg_color;
float bg_energy;
int bg_canvas_max_layer;
@@ -162,7 +162,7 @@ protected:
public:
void set_background(BGMode p_bg);
void set_sky(const Ref<Sky> &p_sky);
- void set_sky_scale(float p_scale);
+ void set_sky_custom_fov(float p_scale);
void set_bg_color(const Color &p_color);
void set_bg_energy(float p_energy);
void set_canvas_max_layer(int p_max_layer);
@@ -172,7 +172,7 @@ public:
BGMode get_background() const;
Ref<Sky> get_sky() const;
- float get_sky_scale() const;
+ float get_sky_custom_fov() const;
Color get_bg_color() const;
float get_bg_energy() const;
int get_canvas_max_layer() const;