This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x2545bfe5bC656486ae64E05739B49636B0eFcb1C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
</head> | |
<body> | |
<select id="age"> | |
<option value="1">20</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
- There's no native support of mulitline text in Canvas, | |
- this function will help you to draw multiline text | |
- by providing max width, line breaks will happen there | |
**/ | |
var wrap_text = (ctx, text, x, y, lineHeight, maxWidth, textAlign) => { | |
if(!textAlign) textAlign = 'center' | |
ctx.textAlign = textAlign | |
var words = text.split(' ') |