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

offsetx and offsety methods added to Python plugins api #3073

Merged
merged 9 commits into from
Jun 1, 2021

Conversation

sverx
Copy link
Contributor

@sverx sverx commented Jun 1, 2021

(not sure why this PR contains all previous commits, it seems I can't cherry pick here)

sverx and others added 6 commits September 19, 2020 15:32
(what was I thinking??? :| )
Previously, holding either Ctrl or Ctrl+Shift while in either "Snap to
Grid" mode or in "Snap to Fine Grid" mode would turn off snapping
entirely. Now only Ctrl turns off snapping entirely, but Ctrl+Shift
toggles between snapping to the grid or to the fine grid.
@bjorn
Copy link
Member

bjorn commented Jun 1, 2021

(not sure why this PR contains all previous commits, it seems I can't cherry pick here)

Yeah, I don't think you can do anything about this on GitHub. In your local repository, you'd need to rebase your last change onto my latest master branch, which already contains the other commits (but merged together as 10c943f).

Once rebased, you can force-push to your master branch to update this PR with just that change.

@@ -331,6 +331,8 @@ def _decorate(obj, *args, **kwargs):
cls_layer.add_method('asObjectGroup', retval('Tiled::ObjectGroup*',reference_existing_object=True), [])
cls_layer.add_method('asImageLayer', retval('Tiled::ImageLayer*',reference_existing_object=True), [])
cls_layer.add_method('asGroupLayer', retval('Tiled::GroupLayer*',reference_existing_object=True), [])
cls_layer.add_method('offsetx', 'double', [])
cls_layer.add_method('offsety', 'double', [])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change as such is insufficient. You'll need to actually run the tiledbinding.py script to update the pythonbind.cpp file.

In addition, the Layer class does not have offsetx and offsety methods. It has QPointF offset() const;. Probably what we need to add here is cls_layer.add_method('offset', 'QPointF', []).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I thought the build process would regenerate that file for me ☹️
Please cancel this, I'll see if I can do better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed the necessary changes.

@bjorn bjorn merged commit ad1bcbb into mapeditor:master Jun 1, 2021
@bjorn
Copy link
Member

bjorn commented Jun 1, 2021

Next time, just be sure to base your changes on the latest master branch in the main repository. Another good practice is to first create a branch, so that you don't end up opening the pull request from your own master, but rather from a branch specific to the pull request.

Thanks for your help with this addition!

@sverx
Copy link
Contributor Author

sverx commented Jun 1, 2021

I'm learning. One day I'll open a proper PR, hopefully 😅
Thank you! ❤️

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

Successfully merging this pull request may close these issues.

2 participants