S
Somebody
I have the following:
struct A
{
int left;
int top;
int right;
int bottom;
};
Thats a rectangle. I have an array of rectangles... say ARR[nCount]... Now,
I've got these elements laid out in rows (not important how), but this
struct has no concept of which row its in...
I'm trying to make every rect in a row equal to the size of the max height
rectangle for that row... I can't seem to come up with a working
algorithm... maybe cuz its late... but my general concept is to first detect
when a new row is hit:
int y = 0;
for (int i = 0; i < nCount; i++)
{
if (ARR.top != y)
{
// NEW ROW
y = ARR.top;
}
else
{
}
}
problem with this right away is that it doesn't hit the NEW ROW part for all
the rectangles... namely the last one... so thats not included in the max
measurement.
any suggestions on how to proceed?
struct A
{
int left;
int top;
int right;
int bottom;
};
Thats a rectangle. I have an array of rectangles... say ARR[nCount]... Now,
I've got these elements laid out in rows (not important how), but this
struct has no concept of which row its in...
I'm trying to make every rect in a row equal to the size of the max height
rectangle for that row... I can't seem to come up with a working
algorithm... maybe cuz its late... but my general concept is to first detect
when a new row is hit:
int y = 0;
for (int i = 0; i < nCount; i++)
{
if (ARR.top != y)
{
// NEW ROW
y = ARR.top;
}
else
{
}
}
problem with this right away is that it doesn't hit the NEW ROW part for all
the rectangles... namely the last one... so thats not included in the max
measurement.
any suggestions on how to proceed?