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

Added Move selection Feature #1607

Closed
wants to merge 17 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@ketanhwr
Contributor

ketanhwr commented Jun 10, 2017

This addresses #650.

It works fine as of now, but I need feedback regarding the flow of this tool. You need to select an area with the tile selection tool, and then select this tool and then move the selection to someplace else. I have a few doubts in mind regarding the flow but I think a feedback would be great!

@Ablu

This comment has been minimized.

Show comment
Hide comment
@Ablu

Ablu Jun 10, 2017

Contributor

A few points I realized while testing:

  • When starting to drag, but still staying on the same tile (so only drag like a pixel to the left or right), the whole map is overlayed with the light blue/gray
  • Sometimes I get a situation like this:
    screenshot from 2017-06-10 17-22-20
    The lower row is nothing what I selected... seems to be a small graphical glitch... It seems to preview one tile to much in width and height. Also the display of those lines seems to lag behind while dragging...

Generally I think the flow of the tool is fine... The only thing which could be annoying is that there is no thing like a floating layer like in Gimp... So if you move tiles on crowded layers you might accidently delete / override tiles...

Contributor

Ablu commented Jun 10, 2017

A few points I realized while testing:

  • When starting to drag, but still staying on the same tile (so only drag like a pixel to the left or right), the whole map is overlayed with the light blue/gray
  • Sometimes I get a situation like this:
    screenshot from 2017-06-10 17-22-20
    The lower row is nothing what I selected... seems to be a small graphical glitch... It seems to preview one tile to much in width and height. Also the display of those lines seems to lag behind while dragging...

Generally I think the flow of the tool is fine... The only thing which could be annoying is that there is no thing like a floating layer like in Gimp... So if you move tiles on crowded layers you might accidently delete / override tiles...

@Ablu

Did a very undetailed review. I guess @bjorn needs to check whether the approach is correct.

Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Jun 12, 2017

Contributor

@Ablu: The clipboard is no longer needed now. I've used the preview layer to paint only. There are still a few bugs.

So if you move tiles on crowded layers you might accidently delete / override tiles...

This can be solved by: Whenever the tool is selected, the selected area remains same, as in, even if it overrides the tiles when you move the selection, it won't actually delete them unless you choose some other tool. I will have to save the preview layer when the tool is first activated and paint when the tool is deactivated.

Contributor

ketanhwr commented Jun 12, 2017

@Ablu: The clipboard is no longer needed now. I've used the preview layer to paint only. There are still a few bugs.

So if you move tiles on crowded layers you might accidently delete / override tiles...

This can be solved by: Whenever the tool is selected, the selected area remains same, as in, even if it overrides the tiles when you move the selection, it won't actually delete them unless you choose some other tool. I will have to save the preview layer when the tool is first activated and paint when the tool is deactivated.

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Jun 12, 2017

Contributor

@Ablu, I've probably fixed all the issues that you've mentioned.

Sometimes I get a situation like this:

I'm not able to reproduce it, it might as well be a graphical error only.

Contributor

ketanhwr commented Jun 12, 2017

@Ablu, I've probably fixed all the issues that you've mentioned.

Sometimes I get a situation like this:

I'm not able to reproduce it, it might as well be a graphical error only.

@bjorn

Yep, this tool is definitely full of challenges. I've tried it out and inspected the code, and here's my feedback. :-)

Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
void activate(MapScene *scene) override;
void deactivate(MapScene *scene) override;

This comment has been minimized.

@bjorn

bjorn Jun 13, 2017

Owner

You'll want to override the default implementations of mouseEntered and mouseLeft, since they're showing/hiding the preview item, which is not what you want for this tool.

@bjorn

bjorn Jun 13, 2017

Owner

You'll want to override the default implementations of mouseEntered and mouseLeft, since they're showing/hiding the preview item, which is not what you want for this tool.

Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated

ketanhwr added some commits Jun 13, 2017

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Jun 13, 2017

Contributor

@bjorn I've made the changes, have a look now 🙂

Contributor

ketanhwr commented Jun 13, 2017

@bjorn I've made the changes, have a look now 🙂

@bjorn

I've provided some minor inline comments, but here's the big suggestion:

You need to select an area with the tile selection tool, and then select this tool and then move the selection to someplace else. I have a few doubts in mind regarding the flow but I think a feedback would be great!

What do you think about trying to merge the new Move tool with the selection tools? Since we have rectangular select, magic wand and select-same-tile, I imagine we could introduce AbstractSelectionTool, which would be used to add the ability to drag the selected tiles to all selection tools. In GIMP, you hold Ctrl+Alt modifiers while dragging to trigger this move behavior, and I think we could do the same in Tiled.

The current behavior is quite good (except, I think clicking outside of the preview should still perform the paste operation), but I also have my doubts about this switching between tools.

Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated
Show outdated Hide outdated src/tiled/moveselectiontool.cpp Outdated

@ketanhwr ketanhwr closed this Jul 10, 2017

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jul 10, 2017

Owner

Just to add an explanatory note: this PR was closed because @ketanhwr introduced an AbstractTileSelectionTool in #1620 and will now merge the functionality of the Move Selection tool added here with that class.

Owner

bjorn commented Jul 10, 2017

Just to add an explanatory note: this PR was closed because @ketanhwr introduced an AbstractTileSelectionTool in #1620 and will now merge the functionality of the Move Selection tool added here with that class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment