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
|
|
@ -1605,8 +1605,8 @@ struct ClipRegions
|
|||
RectangleList<int> inverse (edgeTable.getMaximumBounds());
|
||||
|
||||
if (inverse.subtract (r))
|
||||
for (const Rectangle<int>* i = inverse.begin(), * const e = inverse.end(); i != e; ++i)
|
||||
edgeTable.excludeRectangle (*i);
|
||||
for (auto& i : inverse)
|
||||
edgeTable.excludeRectangle (i);
|
||||
|
||||
return edgeTable.isEmpty() ? nullptr : this;
|
||||
}
|
||||
|
|
@ -1845,14 +1845,14 @@ struct ClipRegions
|
|||
template <class Renderer>
|
||||
void iterate (Renderer& r) const noexcept
|
||||
{
|
||||
for (const Rectangle<int>* i = clip.begin(), * const e = clip.end(); i != e; ++i)
|
||||
for (auto& i : clip)
|
||||
{
|
||||
const int x = i->getX();
|
||||
const int w = i->getWidth();
|
||||
const int x = i.getX();
|
||||
const int w = i.getWidth();
|
||||
jassert (w > 0);
|
||||
const int bottom = i->getBottom();
|
||||
const int bottom = i.getBottom();
|
||||
|
||||
for (int y = i->getY(); y < bottom; ++y)
|
||||
for (int y = i.getY(); y < bottom; ++y)
|
||||
{
|
||||
r.setEdgeTableYPos (y);
|
||||
r.handleEdgeTableLineFull (x, w);
|
||||
|
|
@ -1872,9 +1872,9 @@ struct ClipRegions
|
|||
template <class Renderer>
|
||||
void iterate (Renderer& r) const noexcept
|
||||
{
|
||||
for (const Rectangle<int>* i = clip.begin(), * const e = clip.end(); i != e; ++i)
|
||||
for (auto& i : clip)
|
||||
{
|
||||
const Rectangle<int> rect (i->getIntersection (area));
|
||||
auto rect = i.getIntersection (area);
|
||||
|
||||
if (! rect.isEmpty())
|
||||
{
|
||||
|
|
@ -1912,12 +1912,12 @@ struct ClipRegions
|
|||
{
|
||||
const RenderingHelpers::FloatRectangleRasterisingInfo f (area);
|
||||
|
||||
for (const Rectangle<int>* i = clip.begin(), * const e = clip.end(); i != e; ++i)
|
||||
for (auto& i : clip)
|
||||
{
|
||||
const int clipLeft = i->getX();
|
||||
const int clipRight = i->getRight();
|
||||
const int clipTop = i->getY();
|
||||
const int clipBottom = i->getBottom();
|
||||
const int clipLeft = i.getX();
|
||||
const int clipRight = i.getRight();
|
||||
const int clipTop = i.getY();
|
||||
const int clipBottom = i.getBottom();
|
||||
|
||||
if (f.totalBottom > clipTop && f.totalTop < clipBottom
|
||||
&& f.totalRight > clipLeft && f.totalLeft < clipRight)
|
||||
|
|
@ -2066,8 +2066,8 @@ public:
|
|||
cloneClipIfMultiplyReferenced();
|
||||
RectangleList<int> scaledList;
|
||||
|
||||
for (const Rectangle<int>* i = r.begin(), * const e = r.end(); i != e; ++i)
|
||||
scaledList.add (transform.transformed (*i));
|
||||
for (auto& i : r)
|
||||
scaledList.add (transform.transformed (i));
|
||||
|
||||
clip = clip->clipToRectangleList (scaledList);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue