Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

canvas-dpi-scaler

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-dpi-scaler - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

.npmignore

2

package.json
{
"name": "canvas-dpi-scaler",
"version": "0.0.1",
"version": "0.0.2",
"description": "Utility to scale and <canvas> for Retina and other high resolution screens.",

@@ -5,0 +5,0 @@ "main": "canvas-dpi-scaler.js",

@@ -5,4 +5,23 @@ # Canvas DPI Scaler

### Usage:
*Install with npm or \<script\>:* `npm install canvas-dpi-scaler` or `<script href='canvas-dpi-scaler.js'>`
#### `canvasDpiScaler(canvas, context, [customWidth], [customHeight])`
```js
var canvasDpiScaler = require('canvas-dpi-scaler'),
canvas = document.getElementById('some-canvas-el'),
context = canvas.getContext('2d');
canvasDpiScaler(canvas, context); // That's it; you're done!
```
### About
Based on [this HTML5 rocks article](http://www.html5rocks.com/en/tutorials/canvas/hidpi/).
Written by [@ChrisPolis](http://twitter.com/ChrisPolis), under [MIT License](http://opensource.org/licenses/mit-license.php).
### Demo Screenshot *(from Retina MBP)*
![demo](https://raw.githubusercontent.com/cmpolis/canvas-dpi-scaler/master/demo-screen.png)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc