Fix over-padding and code style
This commit is contained in:
parent
41ec090dac
commit
c796572fb1
|
|
@ -24,7 +24,7 @@ int packRectangles(RectangleType *rectangles, int count, int width, int height,
|
|||
rectangles[i].w += sizeOffset+padding;
|
||||
rectangles[i].h += sizeOffset+padding;
|
||||
}
|
||||
int result = RectanglePacker(width+sizeOffset-padding*2, height+sizeOffset-padding*2).pack(rectangles, count);
|
||||
int result = RectanglePacker(width+sizeOffset-padding, height+sizeOffset-padding).pack(rectangles, count);
|
||||
if (sizeOffset || padding)
|
||||
for (int i = 0; i < count; ++i) {
|
||||
rectangles[i].x += padding;
|
||||
|
|
@ -48,7 +48,7 @@ std::pair<int, int> packRectangles(RectangleType *rectangles, int count, int siz
|
|||
SizeSelector sizeSelector(totalArea);
|
||||
int width, height;
|
||||
while (sizeSelector(width, height)) {
|
||||
if (!RectanglePacker(width+sizeOffset-padding*2, height+sizeOffset-padding*2).pack(rectanglesCopy.data(), count)) {
|
||||
if (!RectanglePacker(width+sizeOffset-padding, height+sizeOffset-padding).pack(rectanglesCopy.data(), count)) {
|
||||
dimensions.first = width;
|
||||
dimensions.second = height;
|
||||
for (int i = 0; i < count; ++i)
|
||||
|
|
|
|||
Loading…
Reference in New Issue