{"id":13745034,"url":"https://github.com/hankpillow/scale-to-fit","last_synced_at":"2025-05-09T04:33:17.878Z","repository":{"id":138511881,"uuid":"1383788","full_name":"hankpillow/scale-to-fit","owner":"hankpillow","description":"small actionscript library which scales an object in order to fit another object's size.","archived":false,"fork":false,"pushed_at":"2011-12-15T18:10:40.000Z","size":104,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-03T05:05:33.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hankpillow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-02-18T19:33:54.000Z","updated_at":"2018-04-01T13:34:39.000Z","dependencies_parsed_at":"2023-03-11T08:51:23.664Z","dependency_job_id":null,"html_url":"https://github.com/hankpillow/scale-to-fit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hankpillow%2Fscale-to-fit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hankpillow%2Fscale-to-fit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hankpillow%2Fscale-to-fit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hankpillow%2Fscale-to-fit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hankpillow","download_url":"https://codeload.github.com/hankpillow/scale-to-fit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224819758,"owners_count":17375321,"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":[],"created_at":"2024-08-03T05:01:20.883Z","updated_at":"2024-11-15T17:31:06.003Z","avatar_url":"https://github.com/hankpillow.png","language":"ActionScript","funding_links":[],"categories":["Unsorted"],"sub_categories":["Other API"],"readme":"# About:\n\nThis is just a very simple class which does scaling objects keeping their proportion.\n\nThe good stuff is that this class can scale properly your object by cropping (using the lower value) it or just fitting by the highest dimension.\n\nThe class API was designed to be ease and intuitive.\n\n##Simple fit:##\n\u003cpre\u003e\nresize(a).toFitIn(b);\n\u003c/pre\u003e\n* * *\n##Crop:##\n\nResize by the lower dimension:\n\n\u003cpre\u003e\nresize(a).toFitIn(b, true);\n\u003c/pre\u003e\n* * *\n##Multipliers##\n\nIn case of resizing videos this [link](http://labs.influxis.com/?p=6)\nhas a good explanation about how important is keeping the proper dimension in videos:\n\n\u003cpre\u003e\nresize(a).multipleOf( 16 ).toFitIn(b);\n\u003c/pre\u003e\n* * *\n##Tweening##\n\nIf you are that guy who loves doing this scale using *\"tween\"*, I did a method for you:\n\n\u003cpre\u003e\nvar r : Rectangle = resize(a).simulate().toFitIn(b).bounds;\nTweener.addTween( a, {width:r.width, height:r.height, time:0.5} );\n\u003c/pre\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhankpillow%2Fscale-to-fit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhankpillow%2Fscale-to-fit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhankpillow%2Fscale-to-fit/lists"}