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

Moving the latest tile #183

Closed
egofree71 opened this Issue Dec 14, 2014 · 4 comments

Comments

Projects
None yet
1 participant
@egofree71
Collaborator

egofree71 commented Dec 14, 2014

I've discovered the following bug : if you move a tile, release the left button and try again to move the same tile, it is not working. This bug was already present, and it is not related to my latest modifications.

@egofree71

This comment has been minimized.

Show comment
Hide comment
@egofree71

egofree71 Dec 14, 2014

Collaborator

The problem comes from the following line (589) in binplane :

public static final class CandidateDepthDataIterator extends ConversionIterator<Candidate,T>

......
@override
protected T convert(Candidate c)
{
return ct.isInstance(c.data) && c.depth == depth ? ct.cast(c.data) : null;
}

When you move the mouse cursor again on the latest tile, the c.depth worths -2147483648. But i've no idea why.

Collaborator

egofree71 commented Dec 14, 2014

The problem comes from the following line (589) in binplane :

public static final class CandidateDepthDataIterator extends ConversionIterator<Candidate,T>

......
@override
protected T convert(Candidate c)
{
return ct.isInstance(c.data) && c.depth == depth ? ct.cast(c.data) : null;
}

When you move the mouse cursor again on the latest tile, the c.depth worths -2147483648. But i've no idea why.

@egofree71

This comment has been minimized.

Show comment
Hide comment
@egofree71

egofree71 Dec 14, 2014

Collaborator

This is a regression problem : it appears since LateralGM 1.8.5.

Collaborator

egofree71 commented Dec 14, 2014

This is a regression problem : it appears since LateralGM 1.8.5.

@egofree71

This comment has been minimized.

Show comment
Hide comment
@egofree71

egofree71 Dec 14, 2014

Collaborator

I've found the real cause : when i implemented a border for selected instances/tiles, i've modified the way tiles are displayed : if a tile/instance is selected, the depth is set to a very low value, so it will ensure that the outside border is always visible. If we don't do that, if the tiles is rounded by other tiles, the border will not be visible.The consequence, is that it's not possible anymore to select and move a selected tile. For instances, it is not a problem, as for selecting one we don't take into account the depth.

The line which causes really the error is in RoomVisual :

if (piece.isSelected())
binVisual.setDepth(this,Integer.MIN_VALUE);

A possible workaround would be to decrease the size of tiles borders, so to make sure they are not displayed outside.

Collaborator

egofree71 commented Dec 14, 2014

I've found the real cause : when i implemented a border for selected instances/tiles, i've modified the way tiles are displayed : if a tile/instance is selected, the depth is set to a very low value, so it will ensure that the outside border is always visible. If we don't do that, if the tiles is rounded by other tiles, the border will not be visible.The consequence, is that it's not possible anymore to select and move a selected tile. For instances, it is not a problem, as for selecting one we don't take into account the depth.

The line which causes really the error is in RoomVisual :

if (piece.isSelected())
binVisual.setDepth(this,Integer.MIN_VALUE);

A possible workaround would be to decrease the size of tiles borders, so to make sure they are not displayed outside.

@egofree71

This comment has been minimized.

Show comment
Hide comment
@egofree71

egofree71 Dec 15, 2014

Collaborator

With pull request #186, instead of using the depth property, i added a new property to ensure that the selected tile is always visible. The issue can be closed. I wait a little bit for feedback before closing.

Collaborator

egofree71 commented Dec 15, 2014

With pull request #186, instead of using the depth property, i added a new property to ensure that the selected tile is always visible. The issue can be closed. I wait a little bit for feedback before closing.

@egofree71 egofree71 closed this Dec 16, 2014

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