Merge pull request #15532 from lethiandev/fix-bitwise-not-op

Fix bitwise NOT operator on BitMap's set_bit
This commit is contained in:
Rémi Verschelde 2018-01-09 22:27:27 +01:00 committed by GitHub
commit cc487f8ce9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}