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

Stamps with different sizes make trouble when using Shape Fill Tool #3533

Closed
UliAbo opened this issue Nov 26, 2022 · 4 comments
Closed

Stamps with different sizes make trouble when using Shape Fill Tool #3533

UliAbo opened this issue Nov 26, 2022 · 4 comments
Assignees
Labels
bug Broken behavior.

Comments

@UliAbo
Copy link

UliAbo commented Nov 26, 2022

Describe the bug
When combining Stamps of different sizes like 3x2, 4x2, 6x2 (see screenshot below), and then using the Shape Fill Tool causes gaps like shown in the GIF below.

Expected behavior
One consistent stream of stamps with no gaps.

Media
SHift

grafik

Specifications:

  • Tiled Version: v1.92
@UliAbo UliAbo added the bug Broken behavior. label Nov 26, 2022
@bjorn
Copy link
Member

bjorn commented Nov 26, 2022

I think the shape fill tool currently just fills the area with a grid based on the largest variation of the stamp.

Since you're using it to draw lines in this case, could you try whether line drawing with the Stamp Brush works better (Shift modifier)? That one should not leave gaps, even with there are variations of different size.

@bjorn bjorn changed the title Bug: Stamps with different sizes make trouble when using with Shape Fill Tool. Stamps with different sizes make trouble when using with Shape Fill Tool. Nov 26, 2022
@bjorn bjorn changed the title Stamps with different sizes make trouble when using with Shape Fill Tool. Stamps with different sizes make trouble when using Shape Fill Tool Nov 26, 2022
@UliAbo
Copy link
Author

UliAbo commented Nov 26, 2022

Thanks @bjorn for your quick reply.
Yes I also tried using Stamp Brush + Shift, but on my end the behavior / effect is the same as with Shape Fill Tool described above. Just tried it again.

@bjorn
Copy link
Member

bjorn commented Dec 4, 2022

Ah, I think what's happening is, it iterates along the line you want to draw, and each time it tries to place a variation, it does an overlap check first. If the variation overlaps with previously placed tiles, it will skip the current location, and try again at the next location. This way, it can happen that a location gets skipped because of a larger variation, after which it can end up choosing a smaller variation at the next location, leaving a gap.

I think for line drawing the fix is simple. Just don't choose a new variation at each point on the line, but only after actually placing a variation.

@bjorn bjorn self-assigned this Dec 4, 2022
bjorn added a commit that referenced this issue Mar 1, 2023
This is also a small optimization since it avoids calling
MapDocument::unifyTilesets when the stamp stays the same (which is
usually the case, since drawing with multiple variations is rare).

See issue #3533
@bjorn bjorn closed this as completed in c4c165f Mar 1, 2023
@bjorn
Copy link
Member

bjorn commented Mar 1, 2023

Both the line drawing and filling should work much nicer now when variations have different sizes. There may still be gaps in some cases, as outlined in c4c165f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Broken behavior.
Projects
None yet
Development

No branches or pull requests

2 participants