Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

//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