Fix handling primitive bbox in vecr::renderer
This commit is contained in:
parent
bc94fe256d
commit
698bd2a60b
1 changed files with 4 additions and 4 deletions
|
|
@ -60,10 +60,10 @@ namespace psemek::vecr
|
||||||
|
|
||||||
auto const box = geom::expand(bbox(primitive.mask), aa);
|
auto const box = geom::expand(bbox(primitive.mask), aa);
|
||||||
|
|
||||||
int xmin = std::max<int>(0, std::floor(box[0].min) * samples_);
|
int xmin = std::floor(std::max(0.f, box[0].min * samples_));
|
||||||
int xmax = std::min<int>(canvas_.width() - 1, std::ceil(box[0].max) * samples_);
|
int xmax = std::floor(std::min(canvas_.width() - 1.f, box[0].max * samples_));
|
||||||
int ymin = std::max<int>(0, std::floor(box[1].min) * samples_);
|
int ymin = std::floor(std::max(0.f, box[1].min * samples_));
|
||||||
int ymax = std::min<int>(canvas_.height() - 1, std::ceil(box[1].max) * samples_);
|
int ymax = std::floor(std::min(canvas_.height() - 1.f, box[1].max * samples_));
|
||||||
|
|
||||||
for (int y = ymin; y <= ymax; ++y)
|
for (int y = ymin; y <= ymax; ++y)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue