Fix BackBufferCopy rect property appearing when not relevant in inspector
The `rect` property is only effective if `copy_mode` is Rect.
This commit is contained in:
parent
cf093f8e47
commit
080b6ac1ae
3 changed files with 14 additions and 6 deletions
|
|
@ -71,12 +71,19 @@ Rect2 BackBufferCopy::get_rect() const {
|
|||
void BackBufferCopy::set_copy_mode(CopyMode p_mode) {
|
||||
copy_mode = p_mode;
|
||||
_update_copy_mode();
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
BackBufferCopy::CopyMode BackBufferCopy::get_copy_mode() const {
|
||||
return copy_mode;
|
||||
}
|
||||
|
||||
void BackBufferCopy::_validate_property(PropertyInfo &p_property) const {
|
||||
if (copy_mode != COPY_MODE_RECT && p_property.name == "rect") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
}
|
||||
|
||||
void BackBufferCopy::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_rect", "rect"), &BackBufferCopy::set_rect);
|
||||
ClassDB::bind_method(D_METHOD("get_rect"), &BackBufferCopy::get_rect);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue