# rect-clamp

> Constraint a Rectangle into another by preserving the ratio.

Latest version **0.0.0** (published 2014-10-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install rect-clamp
pnpm add rect-clamp
yarn add rect-clamp
bun add rect-clamp
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2014-10-05 |
| First published | 2014-10-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Gaëtan Renaudeau |
| Maintainers | gre |
| Keywords | rect, rectangle, 2d, bound, clamp, constraints |

## Links

- npm: https://www.npmjs.com/package/rect-clamp
- Repository: https://github.com/gre/rect-clamp
- Issues: https://github.com/gre/rect-clamp/issues
- npm.io page: https://npm.io/package/rect-clamp

## Recent versions

- 0.0.0 (latest) — 2014-10-05

## README

rect-clamp
==========

Constraint a Rectangle into another by preserving the ratio.

```javascript
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 ]
```

---
_Source: https://npm.io/package/rect-clamp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
