Neat Paraskavedekatriaphobia's Meaning

    rect-clamp

    0.0.0 • Public • Published

    rect-clamp

    Constraint a Rectangle into another by preserving the ratio.

    var rect = rectClamp([-100,-100,200,200], [0,0,800,600]);
    // rect == [0, 0, 200, 200]
    var rect2 = rectClamp([-100,-100,2000,2000], [0,0,800,600]);
    // rect2 == [ 0, 0, 600, 600 ]

    Install

    npm i rect-clamp

    DownloadsWeekly Downloads

    247

    Version

    0.0.0

    License

    ISC

    Last publish

    Collaborators

    • gre