Skip to content

Commit

Permalink
Change sourceSupports behavior to return true when it matches a set o…
Browse files Browse the repository at this point in the history
…f flags instead of any of the specified flags
  • Loading branch information
martincapello committed May 9, 2024
1 parent b000b32 commit c6e5e0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions os/dnd.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace os {
Copy = 1,
Move = 2,
Link = 4,
Any = Copy | Move | Link,
All = Copy | Move | Link,
};

// Types of representations supported for each DragDataItem.
Expand Down Expand Up @@ -99,7 +99,8 @@ namespace os {
void acceptDrop(bool value) { m_acceptDrop = value; }

bool sourceSupports(DropOperation op) {
return static_cast<int>(m_supportedOperations) & static_cast<int>(op);
return (static_cast<int>(m_supportedOperations) & static_cast<int>(op))
== static_cast<int>(op);
}

private:
Expand Down

0 comments on commit c6e5e0c

Please sign in to comment.