New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ctx-get-transform-bugfix

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ctx-get-transform-bugfix

monkey patch CanvasRenderingContext2D to include a getTransform method

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ctx.getTransform()

cxt.getTransform() is one of the missing bits of functionality in CanvasRenderingContext2D. This module will monkey patch a ctx to track the current transformation stack and allows retrieval of the current matrix.

install

npm install ctx-get-transform

use



var canvas = document.createElement('canvas');
var ctx = canvas.getContext('2d');

require('ctx-get-transform')(ctx);

console.log(ctx.getTransform) // outputs: function tGetTransform() ...

ctx.getTransform() // returns a gl-matrix style mat3

api surface

there is only a single method added to the passed ctx, but every method that manipulates the transformation matrix is wrapped.

The awesome method (and purpose of this library):

ctx.getTransform - return a gl-matrix style mat3 (just a 9 element Array)

note: the returned array is not a copy of the tracked matrix. Changing it can result in weird issues! Utilize mat3.clone(ctx.getTransform()) if you need a copy.

license

MIT (see LICENSE.txt)

Keywords

FAQs

Package last updated on 05 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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