summaryrefslogtreecommitdiff
path: root/scene/main/canvas_layer.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-03-02 14:15:25 +0100
committerGitHub <noreply@github.com>2021-03-02 14:15:25 +0100
commit5895cd4c4fe8cf04a7109d52388be46f619b56f1 (patch)
treef9531cd1b9dd5afab64537a1e5e43d00dce14e56 /scene/main/canvas_layer.cpp
parent3fc5ae02aa6f50b153a1b5222046915054b88284 (diff)
parent70304f8633c8cf8faa530dadf648ecfcabf80655 (diff)
Merge pull request #36202 from YeldhamDev/sprite_region_hide
Hide extra options from various nodes if they're not enabled
Diffstat (limited to 'scene/main/canvas_layer.cpp')
-rw-r--r--scene/main/canvas_layer.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/scene/main/canvas_layer.cpp b/scene/main/canvas_layer.cpp
index 91daa08ff8..d9b29daf26 100644
--- a/scene/main/canvas_layer.cpp
+++ b/scene/main/canvas_layer.cpp
@@ -231,6 +231,7 @@ void CanvasLayer::set_follow_viewport(bool p_enable) {
follow_viewport = p_enable;
_update_follow_viewport();
+ notify_property_list_changed();
}
bool CanvasLayer::is_following_viewport() const {
@@ -257,6 +258,14 @@ void CanvasLayer::_update_follow_viewport(bool p_force_exit) {
}
}
+#ifdef TOOLS_ENABLED
+void CanvasLayer::_validate_property(PropertyInfo &property) const {
+ if (!follow_viewport && property.name == "follow_viewport_scale") {
+ property.usage = PROPERTY_USAGE_NOEDITOR;
+ }
+}
+#endif
+
void CanvasLayer::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_layer", "layer"), &CanvasLayer::set_layer);
ClassDB::bind_method(D_METHOD("get_layer"), &CanvasLayer::get_layer);