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

Fixed tile size #12

Closed
marchrius opened this issue May 16, 2016 · 5 comments
Closed

Fixed tile size #12

marchrius opened this issue May 16, 2016 · 5 comments
Labels

Comments

@marchrius
Copy link

There is a way to implement a fixed tiled layout?

@patbuergin-zz
Copy link
Owner

What exactly are you trying to achieve?

The layout is tiled by default, and it could be considered "fixed" if you make it non-editable. Are you referring to fixed as in fixed pixel width/height per item?

@marchrius
Copy link
Author

marchrius commented May 17, 2016

Sorry, I'm too generic.

What I mean is: at the moment I can place a tile in a specific position and a specific dimension. If I add a new tile it will be placed in the biggest available space in the grid. What I'm looking for is to place a new element in the grid with a given fixed width/height and the top/left calculated automatically by the directive. There is a way to accomplish this?

@patbuergin-zz
Copy link
Owner

patbuergin-zz commented May 17, 2016

If that fixed width/height is constant for every new element, you can easily implement this behavior by changing this method to not return the largest empty area, but the most appropriate location that would fit the new element (or null). To preserve backward compatibility, you could switch behavior based on a parameter.

If the width/height does vary, you could get rid of the cached next position, thus re-computing the next position on every call, and consider the desired element size when determining it.

@marchrius
Copy link
Author

Yes, you are right. I might check this function before asking.

I'll try to mod the function or add a total new logic to implement it as new feature.

In the meantime I've modded the lib to use a double binding and parametrize the resizable/movable attributes per item. #13

@patbuergin-zz
Copy link
Owner

Good stuff! I'll process the PR on the weekend.

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

No branches or pull requests

2 participants