pex-context icon indicating copy to clipboard operation
pex-context copied to clipboard

Add programmatic width,height,pixelRatio getters

Open vorg opened this issue 6 years ago • 1 comments

ctx.gl.drawingBufferWidth -> ctx.width

vorg avatar Apr 11 '18 12:04 vorg

Having ctx.width will help with situations where we use different values for different things. It's better if ctx is the source of truth.

var W = 100
var H = 100
var ctx = createContext({ width:W, height: H, pixelRatio: 2 })

ctx.width //200
H //100

vorg avatar Apr 11 '18 12:04 vorg