Required edit vars appear broken (java, javascript)

38 views
Skip to first unread message

Alex Birkett

unread,
Oct 17, 2014, 6:58:23 AM10/17/14
to overcon...@googlegroups.com


I'm working on an Cassowary layout for Android:

https://www.youtube.com/watch?v=f5h-Cc-X4HE&list=UUhNOwhSktPaby5zl3TehZBw

I need the ability to set the intrinsic height/width of views. The value is determined by interrogating the view for a preferred value which is then set as a variable. I've managed to implement this in two different ways:
* Adding and removing linear equation constraints 
* Using stay / edit variables. 

Using edits appears to be quicker than adding and removing linear constraints but I believe there is a bug in the js and java implementations: It's not possible to make the edit var strength 'required':

The java version seems to be more broken than the javascript version. I've sent a pull request with what I believe to be a partial fix.

Any help with a fix appreciated!

Thanks,

Alex



Russell Keith-Magee

unread,
Oct 21, 2014, 6:22:29 AM10/21/14
to overcon...@googlegroups.com
Hi Alex,

We may need to compare notes :-)

I've been working on the same thing to support a larger cross-platform widget project. I won't pretend my implementation is anywhere near complete or efficient - in fact, I know it's painfully inefficient, because it's rebuilding the constraints table on every use - but it Works(tm) (at least for my current testing purposes). 


If there's any room for us to collaborate on this I'd love to be able to. When I get a chance I'll take a look at the patches you've provided and see if they may sense to me.

Yours,
Russ Magee %-)



--
You received this message because you are subscribed to the Google Groups "overconstrained" group.
To unsubscribe from this group and stop receiving emails from it, send an email to overconstrain...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Birkett

unread,
Oct 21, 2014, 9:12:08 AM10/21/14
to overcon...@googlegroups.com
Hi Russ,

I look forward to comparing notes! I hope to get the go-ahead to push to github in the next few days. I'm using cassowary as a library. My cassowary fork is here: https://github.com/alexbirkett/cassowary-java

Cheers,

Alex
Reply all
Reply to author
Forward
0 new messages