Fluid-for-Sketch icon indicating copy to clipboard operation
Fluid-for-Sketch copied to clipboard

Adding constraints like in Xcode?

Open lucidlemon opened this issue 8 years ago • 6 comments

if this would be possible this plugin would be dope. What I mean by that exactly:

In XCode you can select a layer, hold ctrl, drag from your layer to the next layer above it for example and set the constraint to be the top spacing to the other layer.

I know this is very advanced, and I'm not sure if this is possible with the sketch plugin api or if they would have to do that on their own, but that would sick.

Thanks already for the current state of the plugin.

And a minor suggestion: could you check the box of a constraint automatically as soon as you enter a manual value?

lucidlemon avatar Nov 18 '15 15:11 lucidlemon

Hey @lucidlemon thanks so much for the feature request. As for your minor suggestion, it's a great one! Mind adding it as a separate ticket and labeling it under suggestion. Want to make sure the credit is visible/given if and when it is added. :smile:

imcatnoone avatar Nov 18 '15 15:11 imcatnoone

May a non-admin label issues? I know you can do that if you own the repo or have special rights, but I can't see the label interface for new issues :/ however, I'm gonna create a new issue for that, yeah :)

lucidlemon avatar Nov 18 '15 15:11 lucidlemon

@lucidlemon Hmm :confused: good question. Almost positive other folks have been the ones labeling their tickets but I could be going loopy? Give it a try when you create the new ticket. I'll keep an eye out for it. If it doesn't work, I'll add that in there. :+1:

imcatnoone avatar Nov 18 '15 15:11 imcatnoone

nope, tried it while creating #54 but had no luck. Maybe you have to be at least a collaborator to add labels.

lucidlemon avatar Nov 18 '15 15:11 lucidlemon

This is possible, but like you said, it would be quite involved. The problem is that there isn't a good, reliable way to identify layers despite changes to them (yet). Also getting geometry right (the position of a layer in the scroll view, based on document window position, drawing on top of it, figuring out what layer the mouse is over, and so on) would be a task.

As things currently stand, Fluid uses more of a procedural layer traversal technique to resolve constraints, versus some kind of identifier system, which is why you're currently limited to sibling/parent relativity. In the future, I'd like to try and get Fluid to actually leverage AutoLayout behind the scenes, which would make this kind of thing easier (but also comes with its own challenges for implementation).

matt-curtis avatar Nov 18 '15 16:11 matt-curtis

yeah already thought that this might be something harder to grab on. Maybe for version 13.37 ;) Thanks for your quick reply though.

Maybe Bohemion Coding approaches you after they basically ripped your webserver plugin in 3.4 :)

lucidlemon avatar Nov 18 '15 17:11 lucidlemon