{"id":15355463,"url":"https://github.com/ittus/draw-lock-angle","last_synced_at":"2025-04-15T06:28:48.234Z","repository":{"id":57216181,"uuid":"172457191","full_name":"ittus/draw-lock-angle","owner":"ittus","description":"Lock 45, 90, 135, 180... degree when drawing line on Javascript canvas","archived":false,"fork":false,"pushed_at":"2019-05-08T08:46:38.000Z","size":1057,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T17:05:39.729Z","etag":null,"topics":["angle","canvas","horizontal","javascript","vertical"],"latest_commit_sha":null,"homepage":"https://ittus.github.io/draw-lock-angle/","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ittus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-25T07:36:55.000Z","updated_at":"2024-04-21T23:30:05.000Z","dependencies_parsed_at":"2022-08-26T15:01:13.632Z","dependency_job_id":null,"html_url":"https://github.com/ittus/draw-lock-angle","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ittus%2Fdraw-lock-angle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ittus%2Fdraw-lock-angle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ittus%2Fdraw-lock-angle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ittus%2Fdraw-lock-angle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ittus","download_url":"https://codeload.github.com/ittus/draw-lock-angle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837276,"owners_count":21169373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angle","canvas","horizontal","javascript","vertical"],"created_at":"2024-10-01T12:24:28.650Z","updated_at":"2025-04-15T06:28:48.208Z","avatar_url":"https://github.com/ittus.png","language":"Vue","funding_links":["https://www.buymeacoffee.com/8buMYCOog"],"categories":[],"sub_categories":[],"readme":"# draw-lock-angle\nA small library to lock angle when drawing on canvas in Javascript\n\n[![CircleCI](https://circleci.com/gh/ittus/draw-lock-angle/tree/master.svg?style=shield)](https://circleci.com/gh/ittus/draw-lock-angle/tree/master)\n![Size](https://badgen.net/bundlephobia/min/draw-lock-angle)\n\u003e Checkout the demo https://ittus.github.io/draw-lock-angle/\n\n## How to use\n\n### Install\n```\n  yarn add draw-lock-angle\n```\n\n### Usage\n\n```javascript\nimport { calculatePosition } from 'draw-lock-angle'\nprojection = calculatePosition (newPoint, oldPint, config)\n```\n\n## Config\n\n| Prop                  | Type            | Default     | Description                              |\n|-----------------------|-----------------|-------------|------------------------------------------|\n| isSimple                 | Boolean    |      false     | If `isSimple` is true, only calculate projection on horizontal line and vertical line. If `isSimple` is false, calculate the nearest projection on 0, 45, 90, 135-degree line             |\n| boundary                  | Object. Format: {minX: Number, minY: number, maxX: number, maxY: number}         |    undefined         | Boundary of calculation\n\n## Development\n```\nyarn install\n```\n\n### Compiles and hot-reloads for development\n```\nyarn run serve\n```\n\n### Compiles and minifies for production\n```\nyarn run build\n```\n\n### Run your tests\n```\nyarn run test\n```\n\n### Lints and fixes files\n```\nyarn run lint\n```\n\n## Support\n\u003ca href=\"https://www.buymeacoffee.com/8buMYCOog\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: auto !important;width: auto !important;\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fittus%2Fdraw-lock-angle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fittus%2Fdraw-lock-angle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fittus%2Fdraw-lock-angle/lists"}