{"action":"created","issue":{"url":"https://api.github.com/repos/andreaferretti/paths-scala-js/issues/4","labels_url":"https://api.github.com/repos/andreaferretti/paths-scala-js/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/andreaferretti/paths-scala-js/issues/4/comments","events_url":"https://api.github.com/repos/andreaferretti/paths-scala-js/issues/4/events","html_url":"https://github.com/andreaferretti/paths-scala-js/issues/4","id":89486856,"number":4,"title":"A scala way to use path lowlevel","user":{"login":"omidb","id":4734340,"avatar_url":"https://avatars.githubusercontent.com/u/4734340?v=3","gravatar_id":"","url":"https://api.github.com/users/omidb","html_url":"https://github.com/omidb","followers_url":"https://api.github.com/users/omidb/followers","following_url":"https://api.github.com/users/omidb/following{/other_user}","gists_url":"https://api.github.com/users/omidb/gists{/gist_id}","starred_url":"https://api.github.com/users/omidb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omidb/subscriptions","organizations_url":"https://api.github.com/users/omidb/orgs","repos_url":"https://api.github.com/users/omidb/repos","events_url":"https://api.github.com/users/omidb/events{/privacy}","received_events_url":"https://api.github.com/users/omidb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-19T07:02:58Z","updated_at":"2015-06-19T07:35:32Z","closed_at":null,"body":"Hi, thanks again for the Path,\r\n\r\nI wanted to check what is a good way when given a list of point you want to add a path between them (curved, ... any lowlevel function)\r\n\r\nI did this: where ps is a list of `(double,double)`\r\n```scala\r\nval myPath = ps.sliding(2)\r\n                  .foldLeft(Path())((pth,pnts) => {\r\n          val p1 = pnts(0)\r\n          val p2 = pnts(1)\r\n          pth.qcurveto(p1._1, p1._2,p2._1, p2._2)\r\n      }).closepath()\r\n```\r\nI tried this and I cannot see anything happening."},"comment":{"url":"https://api.github.com/repos/andreaferretti/paths-scala-js/issues/comments/113411902","html_url":"https://github.com/andreaferretti/paths-scala-js/issues/4#issuecomment-113411902","issue_url":"https://api.github.com/repos/andreaferretti/paths-scala-js/issues/4","id":113411902,"user":{"login":"andreaferretti","id":1962818,"avatar_url":"https://avatars.githubusercontent.com/u/1962818?v=3","gravatar_id":"","url":"https://api.github.com/users/andreaferretti","html_url":"https://github.com/andreaferretti","followers_url":"https://api.github.com/users/andreaferretti/followers","following_url":"https://api.github.com/users/andreaferretti/following{/other_user}","gists_url":"https://api.github.com/users/andreaferretti/gists{/gist_id}","starred_url":"https://api.github.com/users/andreaferretti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreaferretti/subscriptions","organizations_url":"https://api.github.com/users/andreaferretti/orgs","repos_url":"https://api.github.com/users/andreaferretti/repos","events_url":"https://api.github.com/users/andreaferretti/events{/privacy}","received_events_url":"https://api.github.com/users/andreaferretti/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T07:35:32Z","updated_at":"2015-06-19T07:35:32Z","body":"You are almost there! :-)\r\n\r\nThe only thing that is missing is the `moveto` command, that position the pen somewhere. That has to be the first command, otherwise the SVG path does not have a starting point. Try\r\n\r\n    val myPath = ps.sliding(2).foldLeft(Path().moveto(0, 0))((pth,pnts) => {\r\n        val p1 = pnts(0)\r\n        val p2 = pnts(1)\r\n        pth.qcurveto(p1._1, p1._2,p2._1, p2._2)\r\n    }).closepath()"}}