canvas input: retreive font-size from css
This commit is contained in:
parent
cf8130e589
commit
346513dca1
1 changed files with 2 additions and 1 deletions
|
|
@ -33,6 +33,7 @@
|
|||
|
||||
if (!self.visible || checkColors) {
|
||||
self.color = getComputedStyle(canvas[0]).getPropertyValue("--color-text")
|
||||
self.fontSize = parseInt(getComputedStyle(canvas[0]).getPropertyValue("font-size"))
|
||||
}
|
||||
|
||||
self.val(self.value)
|
||||
|
|
@ -46,7 +47,7 @@
|
|||
if (!self.height || !self.width || (self.height==100 && self.width==100)) return
|
||||
|
||||
ctx.clearRect(0,0,self.width,self.height)
|
||||
ctx.font = PXSCALE * 2 * 12 + 'px Droid Sans'
|
||||
ctx.font = PXSCALE * 2 * self.fontSize + 'px Droid Sans'
|
||||
ctx.textBaseline = "middle"
|
||||
ctx.fillStyle = self.color
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue