Fix #112653: The cross in the UV Grid is not perfectly centered #112676

Open
Philipp Oeser wants to merge 1 commits from lichtwerk/blender:112653 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 9 additions and 6 deletions

View File

@ -148,12 +148,15 @@ static void image_buf_fill_checker_slice(
for (x = 0; x < width; x++) {
float h = 0.125f * floorf(x / checkerwidth);
if ((abs((x % checkerwidth) - (checkerwidth / 2)) < 4) &&
(abs((y % checkerwidth) - (checkerwidth / 2)) < 4))
{
if ((abs((x % checkerwidth) - (checkerwidth / 2)) < 1) ||
(abs((y % checkerwidth) - (checkerwidth / 2)) < 1))
{
const int checkerwidth_half = checkerwidth / 2;
const int test_x = checkerwidth_half - x % checkerwidth;
const int test_y = checkerwidth_half - y % checkerwidth;
const int outer = 4;
const int inner = 2;
if (((test_x > -(outer - 1)) && (test_x < outer)) &&
((test_y > -(outer - 1)) && (test_y < outer))) {
if (((test_x > -(inner - 1)) && (test_x < inner)) ||
((test_y > -(inner - 1)) && (test_y < inner))) {
hsv[0] = fmodf(fabsf(h - hoffs), 1.0f);
hsv_to_rgb_v(hsv, rgb);