Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

close() on path doesn't interact with stroking as expected. #201

Closed
smcallis opened this issue May 12, 2024 · 3 comments
Closed

close() on path doesn't interact with stroking as expected. #201

smcallis opened this issue May 12, 2024 · 3 comments

Comments

@smcallis
Copy link

The close() command on BLPath says that it works like the 'Z' command in SVG and links here. Which indicates that stroking a closed path should join back to the start of the curve. But if I don't manually do a lineTo back to the start, my strokes don't paint fully, which you can see here:

image

@kobalicek
Copy link
Member

Interesting. I couldn't observe this behavior, so I think this would need a snippet that can reproduce it.

For example this fiddle snippet produces the correct output:

BLImage render(const BLContextCreateInfo& cci) {
  BLImage img(500, 500, BL_FORMAT_PRGB32);
  BLContext ctx(img, cci);

  ctx.clearAll();

  BLPath p;
  p.moveTo(200, 100);
  p.lineTo(300, 200);
  p.lineTo(100, 200);
  p.close();

  p.moveTo(200, 300);
  p.lineTo(300, 400);
  p.lineTo(100, 400);
  p.close();

  ctx.strokePath(p, BLRgba32(0xFFFFFFFF));

  return img;
}

@smcallis
Copy link
Author

smcallis commented May 20, 2024 via email

@smcallis
Copy link
Author

smcallis commented Jun 4, 2024

I haven't been able to reproduce this so I think it must have been on my end, though I'm not sure exactly how. I'll refile if I come across a reproduction.

@smcallis smcallis closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants