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

Allows extending of the polyline #1683

Merged
merged 12 commits into from Jan 16, 2018

Conversation

Projects
None yet
3 participants
@ketanhwr
Contributor

ketanhwr commented Aug 11, 2017

#157

TODOs:

  • Don't stop extending after one point. Keep extending until right-click or escape key is encountered.
Show outdated Hide outdated src/tiled/editpolygontool.cpp Outdated
Show outdated Hide outdated src/tiled/editpolygontool.h Outdated
Show outdated Hide outdated src/tiled/editpolygontool.h Outdated
@Ablu

This comment has been minimized.

Show comment
Hide comment
@Ablu

Ablu Aug 18, 2017

Contributor

Hm. Could you rebase this instead of merging the master? For example you reordered the WangTool declaration as it is.

Contributor

Ablu commented Aug 18, 2017

Hm. Could you rebase this instead of merging the master? For example you reordered the WangTool declaration as it is.

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Aug 20, 2017

Contributor

Wait, I'll rebase this.

Contributor

ketanhwr commented Aug 20, 2017

Wait, I'll rebase this.

Show outdated Hide outdated src/tiled/createmultipointobjecttool.cpp Outdated
Show outdated Hide outdated src/tiled/createmultipointobjecttool.cpp Outdated
Show outdated Hide outdated src/tiled/createobjecttool.h Outdated
Show outdated Hide outdated src/tiled/mapeditor.cpp Outdated
@bjorn

It looks like I got interrupted since I just found these comments still pending. :-/

Show outdated Hide outdated src/tiled/createobjecttool.cpp Outdated
Show outdated Hide outdated src/tiled/createobjecttool.cpp Outdated
Show outdated Hide outdated src/tiled/createpolygonobjecttool.cpp Outdated
Show outdated Hide outdated src/tiled/createpolylineobjecttool.cpp Outdated
@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Aug 29, 2017

Contributor

After we start extending the polyline, since we've shifted to the Create Polyline Tool, the color changes back to blue. Is this fine?

Contributor

ketanhwr commented Aug 29, 2017

After we start extending the polyline, since we've shifted to the Create Polyline Tool, the color changes back to blue. Is this fine?

bjorn added some commits Sep 6, 2017

Fixed new polylines being drawn backwards after extending first
The mExtendingFirst variable wasn't being reset.
Fixed extending polyline other than the one just created
The shape and position were not being set on the overlay object when
extending a polyline, so it only worked when those were still set from
the last created polyline.
@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Sep 6, 2017

Owner

After we start extending the polyline, since we've shifted to the Create Polyline Tool, the color changes back to blue. Is this fine?

I hoped it may be fine, but while checking it out it felt strange and it'd probably be better for just the new segment to be blue.

I've pushed two bugfixes for things I noticed while testing.

In addition to not coloring the whole line blue, I think we need to find a way to have the new segment show up immediately. Currently, you have to move your mouse at least once after clicking "Extend Polyline" to make the new segment show up.

Owner

bjorn commented Sep 6, 2017

After we start extending the polyline, since we've shifted to the Create Polyline Tool, the color changes back to blue. Is this fine?

I hoped it may be fine, but while checking it out it felt strange and it'd probably be better for just the new segment to be blue.

I've pushed two bugfixes for things I noticed while testing.

In addition to not coloring the whole line blue, I think we need to find a way to have the new segment show up immediately. Currently, you have to move your mouse at least once after clicking "Extend Polyline" to make the new segment show up.

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Sep 6, 2017

Contributor

So probably, when the user clicks on the first/last node, the extending should begin?

Contributor

ketanhwr commented Sep 6, 2017

So probably, when the user clicks on the first/last node, the extending should begin?

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Sep 6, 2017

Owner

So probably, when the user clicks on the first/last node, the extending should begin?

Well, then it would work mostly like Vectr, right? But if it's just activated on click, then we can't switch tools because we'd need it to not interfere with just trying to select some nodes.

Or, it would need to work like Inkscape, where the nodes to click for extending the polyline are only visible in the "Insert Polyline" tool.

Or we find some way to place the new node based on the current mouse position before we get the next mouse move event.

Owner

bjorn commented Sep 6, 2017

So probably, when the user clicks on the first/last node, the extending should begin?

Well, then it would work mostly like Vectr, right? But if it's just activated on click, then we can't switch tools because we'd need it to not interfere with just trying to select some nodes.

Or, it would need to work like Inkscape, where the nodes to click for extending the polyline are only visible in the "Insert Polyline" tool.

Or we find some way to place the new node based on the current mouse position before we get the next mouse move event.

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Dec 14, 2017

Contributor

@bjorn what exactly was wrong here? I'd like to get this one merged.

Contributor

ketanhwr commented Dec 14, 2017

@bjorn what exactly was wrong here? I'd like to get this one merged.

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Dec 14, 2017

Owner

@ketanhwr The main issues I seem to have ran into was that you need to move the mouse for the line to show up when extending the polyline, and that the whole thing turns blue rather than just the new line.

For the overal implementation, I'd have to take a detailed look again and consider alternatives, but right now I'm trying to finish some stuff people have been paying for. Either this week or the next I'm also going to look at making some improvements to the polygon editing in general.

Owner

bjorn commented Dec 14, 2017

@ketanhwr The main issues I seem to have ran into was that you need to move the mouse for the line to show up when extending the polyline, and that the whole thing turns blue rather than just the new line.

For the overal implementation, I'd have to take a detailed look again and consider alternatives, but right now I'm trying to finish some stuff people have been paying for. Either this week or the next I'm also going to look at making some improvements to the polygon editing in general.

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Dec 14, 2017

Contributor

Alright 🙂

Contributor

ketanhwr commented Dec 14, 2017

Alright 🙂

Merge branch 'master' into ketanhwr-extending
Conflicts:
	src/tiled/editpolygontool.cpp
@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jan 12, 2018

Owner

Hmm, I realized another problem with this implementation. Since it goes through the MapEditor, the "Extend Polyline" action does nothing when used in the Tile Collision Editor, unless we duplicate the same connection setup in the TileCollisionDock.

I'm considering a rather big rewrite of the whole polygon editing functionality, or at least to re-think it all from scratch based on the wishlist of functionality, because of the difficulties with putting such small functions on top of the current implementation.

Owner

bjorn commented Jan 12, 2018

Hmm, I realized another problem with this implementation. Since it goes through the MapEditor, the "Extend Polyline" action does nothing when used in the Tile Collision Editor, unless we duplicate the same connection setup in the TileCollisionDock.

I'm considering a rather big rewrite of the whole polygon editing functionality, or at least to re-think it all from scratch based on the wishlist of functionality, because of the difficulties with putting such small functions on top of the current implementation.

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Jan 12, 2018

Contributor

I'm considering a rather big rewrite of the whole polygon editing functionality, or at least to re-think it all from scratch based on the wishlist of functionality, because of the difficulties with putting such small functions on top of the current implementation.

Interested in helping with this.

Contributor

ketanhwr commented Jan 12, 2018

I'm considering a rather big rewrite of the whole polygon editing functionality, or at least to re-think it all from scratch based on the wishlist of functionality, because of the difficulties with putting such small functions on top of the current implementation.

Interested in helping with this.

bjorn added some commits Jan 16, 2018

Enabled switching between tools using the ToolManager
This way, the "Extend Polyline" action also works in the Tile Collision
Editor.

Also, it no longer appears in the Template view, because with the
current implementation it can't work there since the "Insert Polyline"
tool is not available there.
Fixed behavior when switching tools while extending a polyline
Don't switch to EditPolygonTool when user selected another tool. This
isn't what the user wants and it broke stuff.
Simplified code
There appears to be no difference between finishing or canceling the
extending of a polyline. In both cases we switch back to the "Edit
Polygons" tool and in both cases we should also make sure the object we
were extending is selected.

There shouldn't actually be a reason to touch the selection at all when
starting or stopping to extend a polyline, but currently the selection
outline does not update as expected while extending a polyline.
@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jan 16, 2018

Owner

A few more fixes later, I think we can merge this, but I'll still be looking at redoing the general setup.

Interested in helping with this.

That is appreciated, but I'm under some time pressure to improve this aspect of Tiled and I don't currently see how we can do this together.

Owner

bjorn commented Jan 16, 2018

A few more fixes later, I think we can merge this, but I'll still be looking at redoing the general setup.

Interested in helping with this.

That is appreciated, but I'm under some time pressure to improve this aspect of Tiled and I don't currently see how we can do this together.

@bjorn bjorn merged commit 5dc2194 into bjorn:master Jan 16, 2018

0 of 2 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment