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

Large 'lineWidths' for raster graphics are clipped by the bounding box. #2490

Closed
V-A-Kaiser opened this issue Sep 10, 2022 · 3 comments · Fixed by #2662
Closed

Large 'lineWidths' for raster graphics are clipped by the bounding box. #2490

V-A-Kaiser opened this issue Sep 10, 2022 · 3 comments · Fixed by #2662
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior

Comments

@V-A-Kaiser
Copy link

V-A-Kaiser commented Sep 10, 2022

Steps to Reproduce

Create a new circle raster and add it to an actor with the following code.

const baseCircle = new Circle({
  radius: 100
  lineWidth: 50,
  color: Color.White,
  strokeColor: Color.White.darken(0.2),
  quality: 2
});

this.graphics.add("Base", baseCircle);
this.graphics.show("Base");

Expected Result

The bounding box is given extra padding based on the line width so that it is not clipped.

Actual Result

The line generated by the raster graphic is clipped by the bounding box.

image

Workarounds

Explicitly defining a 'padding' value solves the clipping problem, but the raster renderer should take this into account implicitly.

const baseCircle = new Circle({
  radius: 100
  lineWidth: 50,
  color: Color.White,
  strokeColor: Color.White.darken(0.2),
  padding: 25,
  quality: 2
});

Environment

  • Browser: Chrome (Version 105.0.5195.102 (Official Build) (64-bit))
  • OS: Windows 10
  • Excalibur Version: Excalibur.js v0.27.0
@eonarheim
Copy link
Member

Hi @CTLaChance, thanks for the issue!

Totally agree, this is unexpected

@github-actions
Copy link

This issue hasn't had any recent activity lately and is being marked as stale automatically.

@github-actions github-actions bot added the stale This issue or PR has not had any activity recently label Nov 11, 2022
@eonarheim eonarheim added the bug This issue describes undesirable, incorrect, or unexpected behavior label Jun 11, 2023
@github-actions github-actions bot removed the stale This issue or PR has not had any activity recently label Jun 12, 2023
@eonarheim
Copy link
Member

One workaround here may be to set the Circle.padding to increase the size of the underlying bitmap.

eonarheim added a commit that referenced this issue Jun 15, 2023
Closes #2490 

The PR adjusts the underlying padding dynamically to account for lineWidth in the `Circle` constructor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants