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

canvas-app

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-app - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

14

index.js

@@ -169,2 +169,16 @@ var isGL = require('is-webgl-context');

Object.defineProperty(CanvasApp.prototype, 'deviceWidth', {
get: function() {
return this.width * this._DPR;
}
});
Object.defineProperty(CanvasApp.prototype, 'deviceHeight', {
get: function() {
return this.height * this._DPR;
}
});
CanvasApp.prototype.resetFPS = function() {

@@ -171,0 +185,0 @@ this._frames = 0;

2

package.json
{
"name": "canvas-app",
"version": "2.2.0",
"version": "2.3.0",
"description": "sets up a retina-scaled canvas with render loop",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -91,9 +91,12 @@ # canvas-app

- `running` whether the loop is currently running
- `deviceWidth`, `deviceHeight` the actual device height (i.e. size * devicePixelRatio). This is needed for glViewport, glScissor, etc.
### context scaling / viewport
Before rendering, the 2d context is scaled to the device size (or the scale remains unchanged if `retina` was false). If the context is `"webgl"`, then instead `gl.viewport` will be called with the device size.
For 2D contexts, `scale()` is called before rendering based on the deviePixelRatio. For WebGL contexts, `gl.viewport()` is called before rendering with the device size.
If `retina` is false, the device size will be assumed to be the same as the canvas size.
## License
MIT, see [LICENSE.md](http://github.com/mattdesl/canvas-app/blob/master/LICENSE.md) for details.
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