diff options
author | Julian Eisel <julian@blender.org> | 2021-01-24 22:39:09 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-01-24 23:29:14 +0300 |
commit | f04206cbc7129603a7c437b79b1d1c99bd191783 (patch) | |
tree | a33f217ee230f248295fedd6530422ba2f1317a4 /source/blender/editors/space_node/space_node.c | |
parent | e747c07156cce226dde25309b4346f8354103a24 (diff) |
Cleanup: Add/use helper to check if dragging a certain ID type or asset ID type
This check is a common pattern, avoid duplication by using a helper function.
Diffstat (limited to 'source/blender/editors/space_node/space_node.c')
-rw-r--r-- | source/blender/editors/space_node/space_node.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 66a029c2087..94915022ce9 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -664,7 +664,7 @@ static bool node_ima_drop_poll(bContext *UNUSED(C), /* rule might not work? */ return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE)); } - return WM_drag_get_local_ID(drag, ID_IM) || WM_drag_get_asset_data(drag, ID_IM); + return WM_drag_is_ID_type(drag, ID_IM); } static bool node_mask_drop_poll(bContext *UNUSED(C), @@ -672,7 +672,7 @@ static bool node_mask_drop_poll(bContext *UNUSED(C), const wmEvent *UNUSED(event), const char **UNUSED(r_tooltip)) { - return WM_drag_get_local_ID(drag, ID_MSK) || WM_drag_get_asset_data(drag, ID_MSK); + return WM_drag_is_ID_type(drag, ID_MSK); } static void node_id_drop_copy(wmDrag *drag, wmDropBox *drop) |