Skip to content
Myr

Merge branch 'fix_issue-701' of https://github.com/rygorous/stb into working

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parents 742056d, ae431d7 · Browse files · 1 file+9 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−1 removed

  • other:+9 added−1 removed

1 file+9 added−1 removed

modified:stb_rect_pack.h+9 added-1 removed
29 unmodified lines
30// github:IntellectualKitty31// 32// Bugfixes / warning fixes33// Jeremy Jaussaud34// Fabian Giesen35//36// Version history:37//38// 0.99 (2019-02-07) warning fixes
309 unmodified lines
348 width = (width + c->align - 1);349 width -= width % c->align;350 STBRP_ASSERT(width % c->align == 0);351352 // if it can't possibly fit, bail immediately353 if (width > c->width || height > c->height) {354 fr.prev_link = NULL;355 fr.x = fr.y = 0;356 return fr;357 }358359 node = c->active_head;360 prev = &c->active_head;361 while (node->x + width <= c->width) {362 int y,waste;
55 unmodified lines
418 node = node->next;419 }420 STBRP_ASSERT(node->next->x > xpos && node->x <= xpos);421 y = stbrp__skyline_find_min_y(c, node, xpos, width, &waste);414 if (y + height < c->height) {422 if (y + height <= c->height) {423 if (y <= best_y) {424 if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {425 best_x = xpos;426 STBRP_ASSERT(y <= best_y);
201 unmodified lines