-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow to close a poly line #404
Comments
If you want to make a closed polygon, why not just use the Polygon tool rather than the Polyline tool? Do you intend to create a non-filled but closed polyline? Also, how would you "unjoin" the start and end points? I'm afraid such features will make the polygon editing a lot more complicated. Of course, that's no problem if you want to implement it yourself or pay reasonably for the effort. What would be straight-forward would be an option to convert a polyline to a polygon and vica versa. |
In my case, yes I want a non filled closed poly line. I am using poly lines to create paths for my AI, and want them to act differently based on whether they are open or closed. For now I just set it so that if the starting and ending points reside on the same location, it should be considered closed. I could use a polygon, but that makes a mess graphically. Not sure why it would be complicated, but then I didn't look at Tiled's source. Maybe I'll check it out some time. |
@wolfscaptain It's not complicated to snap to the starting node. It's complicated to think about the situation that comes afterwards, unless you think it requires no special handling. If start and end point are on the same position, you will no longer recognize them as end-points and it may take a few trial and error before you locate the point where you can "untie" the polygon. Maybe you're just looking for an option to disable the filling of polygons? |
Disabling polygon filling would be a nifty feature, especially if that is saved in the tmx file as an attribute or something. |
You don't need to search for a point, you could break it at any. It's just a linked list as far as I can tell. This can be taken a step further so that you could break any point and if the poly line itself is broken than it creates the needed object for the newly broken line, but that's not really related to a 2D level editor. :) Don't bother if it's a hassle though, I can just put the starting and ending points on the same position, and then handle the rest in my code. |
@wolfscaptain Those kind of things is what I would call complicated. If not done right, it's very easy to get a confusing UI and an ugly implementation. I currently do not have the time nor motivation to work on it, especially since it's not exactly a core feature anyway, but if it's important to you feel free to contribute a patch. I had a choice between supporting polygons that can be arbitrarily broken apart or closed, etc. (like in Inkscape), or supporting closed and open polygons as separate objects. I went for the latter because I preferred its simplicity. Also, it was a sponsored feature and as it is it fulfilled the use-case. Taking it further would have increased the budget. |
In the current |
If an end point of a poly line is next to the starting point, it should snap to it to form a closed shape.
In addition, allow to join the starting and ending points of an already constructed poly line.
The text was updated successfully, but these errors were encountered: