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

Dragging tags outside of component fixed #18

Merged
merged 5 commits into from
Jul 20, 2020

Conversation

Nielswps
Copy link
Contributor

This makes sure that the tags for guards, selections, and so on are always snapped to a location inside the component, when they are dragged outside the component

@Nielswps Nielswps self-assigned this Jul 16, 2020
@Nielswps Nielswps linked an issue Jul 16, 2020 that may be closed by this pull request
@Nielswps Nielswps marked this pull request as ready for review July 17, 2020 08:10
@Nielswps Nielswps added the enhancement 💡 new feature idea label Jul 17, 2020
@Nielswps Nielswps added this to the 2.3 milestone Jul 17, 2020
@@ -212,6 +215,37 @@ private void initializeShape() {
textField.requestFocus(); // This needs to be done twice because of reasons
}

//Handle constraints for guards, selects, synchronizations, and updates
if(getParent() instanceof NailPresentation){
if(getParent().localToParent(getBoundsInParent()).getCenterX() > getComponent().widthProperty().doubleValue() - textField.getWidth()) {
Copy link
Member

Choose a reason for hiding this comment

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

It seems the two cases are very similar, I think there should be a function (or just extract the object that you work on)

somthing like:
if (getParent() instanof NailPresentation) {
o = getParent()
} else {
o = getParent.getParent()
}

if (o.localToParent(...
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely, must have missed it as I ran through it

@yrke yrke merged commit ec5fdf9 into DEIS-Tools:master Jul 20, 2020
@Nielswps Nielswps deleted the labelDragFix branch July 20, 2020 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 💡 new feature idea
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make it impossible to move text labels outside the frame of a component
2 participants