mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Modernised a few RectangleList iterators
This commit is contained in:
parent
d5c019e983
commit
38d49a5ee7
12 changed files with 66 additions and 64 deletions
|
|
@ -133,13 +133,13 @@ EdgeTable::EdgeTable (const RectangleList<int>& rectanglesToAdd)
|
|||
allocate();
|
||||
clearLineSizes();
|
||||
|
||||
for (const Rectangle<int>* r = rectanglesToAdd.begin(), * const e = rectanglesToAdd.end(); r != e; ++r)
|
||||
for (auto& r : rectanglesToAdd)
|
||||
{
|
||||
const int x1 = r->getX() << 8;
|
||||
const int x2 = r->getRight() << 8;
|
||||
int y = r->getY() - bounds.getY();
|
||||
const int x1 = r.getX() << 8;
|
||||
const int x2 = r.getRight() << 8;
|
||||
int y = r.getY() - bounds.getY();
|
||||
|
||||
for (int j = r->getHeight(); --j >= 0;)
|
||||
for (int j = r.getHeight(); --j >= 0;)
|
||||
addEdgePointPair (x1, x2, y++, 255);
|
||||
}
|
||||
|
||||
|
|
@ -156,13 +156,13 @@ EdgeTable::EdgeTable (const RectangleList<float>& rectanglesToAdd)
|
|||
allocate();
|
||||
clearLineSizes();
|
||||
|
||||
for (const Rectangle<float>* r = rectanglesToAdd.begin(), * const e = rectanglesToAdd.end(); r != e; ++r)
|
||||
for (auto& r : rectanglesToAdd)
|
||||
{
|
||||
const int x1 = roundToInt (r->getX() * 256.0f);
|
||||
const int x2 = roundToInt (r->getRight() * 256.0f);
|
||||
const int x1 = roundToInt (r.getX() * 256.0f);
|
||||
const int x2 = roundToInt (r.getRight() * 256.0f);
|
||||
|
||||
const int y1 = roundToInt (r->getY() * 256.0f) - (bounds.getY() << 8);
|
||||
const int y2 = roundToInt (r->getBottom() * 256.0f) - (bounds.getY() << 8);
|
||||
const int y1 = roundToInt (r.getY() * 256.0f) - (bounds.getY() << 8);
|
||||
const int y2 = roundToInt (r.getBottom() * 256.0f) - (bounds.getY() << 8);
|
||||
|
||||
if (x2 <= x1 || y2 <= y1)
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -352,11 +352,11 @@ public:
|
|||
|
||||
for (int j = 0; j < rects.size(); ++j)
|
||||
{
|
||||
const RectangleType& rect = rects.getReference (j);
|
||||
auto& rect = rects.getReference (j);
|
||||
|
||||
for (const Rectangle<OtherValueType>* r = other.begin(), * const e = other.end(); r != e; ++r)
|
||||
for (auto& r : other)
|
||||
{
|
||||
RectangleType clipped (r->template toType<ValueType>());
|
||||
auto clipped = r.template toType<ValueType>();
|
||||
|
||||
if (rect.intersectRectangle (clipped))
|
||||
result.rects.add (clipped);
|
||||
|
|
@ -386,7 +386,7 @@ public:
|
|||
{
|
||||
for (int i = rects.size(); --i >= 0;)
|
||||
{
|
||||
RectangleType r (rects.getReference (i));
|
||||
auto r = rects.getReference (i);
|
||||
|
||||
if (rect.intersectRectangle (r))
|
||||
destRegion.rects.add (r);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue