* Change the += operator for bounding boxes to |=, which better represents what is happening, and avoids future confusion with "FTBBox + FTPoint" constructs.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
diff --git a/src/FTFont/FTFont.cpp b/src/FTFont/FTFont.cpp
index 2c9b070..3a71b6f 100644
--- a/src/FTFont/FTFont.cpp
+++ b/src/FTFont/FTFont.cpp
@@ -454,7 +454,7 @@ inline FTBBox FTFontImpl::BBoxI(const T* string, const int start, const int end)
FTBBox tempBBox = glyphList->BBox(string[i]);
tempBBox.Move(FTPoint(advance, 0.0f, 0.0f));
- totalBBox += tempBBox;
+ totalBBox |= tempBBox;
advance += glyphList->Advance(string[i], string[i + 1]);
}
}
diff --git a/src/FTGL/FTBBox.h b/src/FTGL/FTBBox.h
index 47a2722..faf2d5f 100644
--- a/src/FTGL/FTBBox.h
+++ b/src/FTGL/FTBBox.h
@@ -128,7 +128,7 @@ class FTGL_EXPORT FTBBox
return *this;
}
- FTBBox& operator += (const FTBBox& bbox)
+ FTBBox& operator |= (const FTBBox& bbox)
{
if(bbox.lower.X() < lower.X()) lower.X(bbox.lower.X());
if(bbox.lower.Y() < lower.Y()) lower.Y(bbox.lower.Y());
diff --git a/src/FTLayout/FTSimpleLayout.cpp b/src/FTLayout/FTSimpleLayout.cpp
index e57c214..ce4faaa 100644
--- a/src/FTLayout/FTSimpleLayout.cpp
+++ b/src/FTLayout/FTSimpleLayout.cpp
@@ -401,7 +401,7 @@ inline void FTSimpleLayoutImpl::OutputWrappedI(const T *buf, const int start,
// See if this is the first area to be added to the bounds
if(bounds->IsValid())
{
- *bounds += temp;
+ *bounds |= temp;
}
else
{