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

Add a "stretch fill" tool for rectangles (here's how it should work) #3025

Open
zocky opened this issue Apr 10, 2021 · 1 comment
Open

Add a "stretch fill" tool for rectangles (here's how it should work) #3025

zocky opened this issue Apr 10, 2021 · 1 comment
Labels
feature It's a feature, not a bug.

Comments

@zocky
Copy link

zocky commented Apr 10, 2021

A stretch fill tool (or maybe a stretch mode for the shape fill tool) would be very useful, as has been commented many times. It's not instantly obvious how it should work, so I gave it some thought and figured it would be good to write it down:

The behavior should depend on the dimensions of the currently selected stamp:

  • If three or more columns are selected, the leftmost and rightmost columns should be drawn once on the left and right borders of the drawn rectangle, and the columns between should be repeated.
  • If exactly two columns are selected, one of them should be used as the border, and the other as the fill. Which is which depends on which way the user is drawing the rectangle. If they're going rightwards, the left column should be used drawn once, and the right column should be repeated, and vice versa.
  • If exactly one column is selected, it should be repeated.
  • The exact same behavior applies to rows on the other axis.

This would mean that 3×3 stamp would draw a completely bordered rectangle, a 2×3 stamp would omit the border on one side, and 2×2 would omit it on two sides, and 2×1 would draw it only on one side.

@bjorn
Copy link
Member

bjorn commented Apr 11, 2021

I've actually implemented a tool with most of this functionality as a JavaScript extension (while live-streaming), the extension can be found in the tiled-extensions repository.

  • If exactly two columns are selected, one of them should be used as the border, and the other as the fill. Which is which depends on which way the user is drawing the rectangle. If they're going rightwards, the left column should be used drawn once, and the right column should be repeated, and vice versa.

I think this is the only case which isn't handled as nicely in the extension, but support for this could easily be added. It's a nice idea!

I agree it would be nice to make this functionality part of the Shape Fill Tool. Since it would need to be optional it will require a bit of additional UI in the tool bar.

@bjorn bjorn added the feature It's a feature, not a bug. label Apr 11, 2021
@bjorn bjorn mentioned this issue Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature It's a feature, not a bug.
Projects
None yet
Development

No branches or pull requests

2 participants