{"action":"opened","issue":{"url":"https://api.github.com/repos/IjzerenHein/autolayout.js/issues/11","labels_url":"https://api.github.com/repos/IjzerenHein/autolayout.js/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/IjzerenHein/autolayout.js/issues/11/comments","events_url":"https://api.github.com/repos/IjzerenHein/autolayout.js/issues/11/events","html_url":"https://github.com/IjzerenHein/autolayout.js/issues/11","id":116503608,"number":11,"title":"Top and left coordinates issue","user":{"login":"nikitagit","id":4191349,"avatar_url":"https://avatars.githubusercontent.com/u/4191349?v=3","gravatar_id":"","url":"https://api.github.com/users/nikitagit","html_url":"https://github.com/nikitagit","followers_url":"https://api.github.com/users/nikitagit/followers","following_url":"https://api.github.com/users/nikitagit/following{/other_user}","gists_url":"https://api.github.com/users/nikitagit/gists{/gist_id}","starred_url":"https://api.github.com/users/nikitagit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikitagit/subscriptions","organizations_url":"https://api.github.com/users/nikitagit/orgs","repos_url":"https://api.github.com/users/nikitagit/repos","events_url":"https://api.github.com/users/nikitagit/events{/privacy}","received_events_url":"https://api.github.com/users/nikitagit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-12T08:43:23Z","updated_at":"2015-11-12T08:43:23Z","closed_at":null,"body":"If you don`t mind, I repeat the question, that I wrote you by email and add some material!\r\nI am working on a personal project related with iOS \"Storyboard\" design.\r\nAs a core layout system, I chose your AutoLayout.js library, because it is claimed as the Apple's algorithm which they use in Xcode and iOS applications.\r\nHowever, the lack of examples makes it difficult to understand how to use it.\r\n\r\nIn particular the problem is: my program loads \".storyboard\" file which has some widgets and constraints tags defined in View. Then I add constraints directly from storyboard to autolayout library in that way:\r\n\r\nfrom:\r\n\r\n<constraint firstItem=\"first_id\" firstAttribute=\"left\" secondItem=\"button_id\" secondAttribute=\"left\" constant=\"10\" id=\"constraint_id\"/>\r\n\r\nto:\r\n\r\nautolayoutView.addConstraint({\r\n          view1: \"view_id\",\r\n          attr1: \"left\",\r\n          relation: \"equ\",\r\n          view2: \"button_id\",\r\n          attr2: \"left\",\r\n          constant: 10,\r\n          multiplier: 1\r\n});\r\n\r\nand then set the size of subView and View:\r\n\r\nautolayoutView.setSize(600, 600);\r\nautolayoutView.subViews.button_id.intrinsicWidth = 100;\r\nautolayoutView.subViews.button_id.intrinsicHeight = 100;\r\n\r\nSo, after that the solver gives me some strange values:\r\nbottom: 0 centerX: 40 centerY: -50 height: 100 intrinsicHeight: 100 intrinsicWidth: 100 left: -10 name: \"child1\" right: 90 top: -100 type: undefined width: 100 zIndex: 0\r\n\r\nThat's not the information that is useful for me, since the solver __don't know anything about current position of an element__ in order for me to reposition them.\r\nAnd it is not suitable for me to use VFL implementation.\r\n\r\nThe main problem, that I faced, that I can not re-position my widgets due to the lack of initial coordinates (top and left are similar to x and y). For example, if I have left button constraint to the parent view left with 10 value (like in constraint tag), then the position of the element will be the same, only left part will change from the current position to the position which has 10 margin from the parent view. Could this somehow be resolved?\r\n\r\nCould you, please, explain, maybe I miss something? Thank you!! Your help would be great!"}}