summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-01-09 22:27:27 +0100
committerGitHub <noreply@github.com>2018-01-09 22:27:27 +0100
commitcc487f8ce9ba1b308f048905a1e5253abd740310 (patch)
tree4319f7e30dcbc036ef24e5bab7dc3d51654decc8
parent302dfea2f096b07c0d6e991402c90817c3b5ed6c (diff)
parentc73589305eae7d146fad2026039d7859b1869675 (diff)
Merge pull request #15532 from lethiandev/fix-bitwise-not-op
Fix bitwise NOT operator on BitMap's set_bit
-rw-r--r--scene/resources/bit_mask.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/resources/bit_mask.cpp b/scene/resources/bit_mask.cpp
index e99db8d9cb..e9e15a2532 100644
--- a/scene/resources/bit_mask.cpp
+++ b/scene/resources/bit_mask.cpp
@@ -81,7 +81,7 @@ void BitMap::set_bit_rect(const Rect2 &p_rect, bool p_value) {
if (p_value)
b |= (1 << bbit);
else
- b &= !(1 << bbit);
+ b &= ~(1 << bbit);
data[bbyte] = b;
}
@@ -127,7 +127,7 @@ void BitMap::set_bit(const Point2 &p_pos, bool p_value) {
if (p_value)
b |= (1 << bbit);
else
- b &= !(1 << bbit);
+ b &= ~(1 << bbit);
bitmask[bbyte] = b;
}