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

canvas-hidden-transform

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

canvas-hidden-transform

Apply extra 'hidden' transformations to a CanvasRenderingContext2D

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

This is a microlibrary for enabling custom 'hidden' transformations on any CanvasRenderingContext2D. It is especially useful for rapidly implementing high-quality rendering, but can be used for various other scenarios, too. Example:

const addTransform = require('canvas-hidden-transform')

const canvas = document.createElement('canvas')
const ctxt = canvas.getContext('2d')

// this will translate any point by [10, 10]
const myTransform = [1, 0, 0, 1, 10, 10]

const myCtxt = addTransform(ctxt, myTransform)

myCtxt.translate(5, 3)
// will draw a rectangle from [15,13] to [20,18]
myCtxt.fillRect(0,0,5,5) 

For more information on how a transformation works, read this MDN article.

Keywords

FAQs

Package last updated on 28 Jun 2017

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