mirror of
https://github.com/wassname/CanvasTextWrapper.git
synced 2026-06-28 03:47:49 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 66da3411c3 | |||
| a1ba88647e | |||
| 13abe2526c |
@@ -52,7 +52,12 @@
|
||||
|
||||
CanvasTextWrapper.prototype = {
|
||||
_init: function() {
|
||||
this.fontSize = parseInt(this.font.replace(/^\D+/g,''),10) || 18;
|
||||
/* Substituting this line that causing a bug with font-weight numeric values */
|
||||
//this.fontSize = parseInt(this.font.replace(/^\D+/g,''),10) || 18;
|
||||
|
||||
/* This line allow font values like : "italic 500 25px" to preserve both numeric a literal value of font-weight*/
|
||||
this.fontSize = this.font.match(/\d+(px|em|\%)/g) ? +this.font.match(/\d+(px|em|\%)/g)[0].match(/\d+/g) : 18;
|
||||
|
||||
this.textBlockHeight = 0;
|
||||
this.lines = [];
|
||||
this.newLineIndexes = [];
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "canvas-text-wrapper",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"**/*.log",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "canvas-text-wrapper",
|
||||
"description": "Pure JavaScript canvas text wrapper that automatically splits a string into lines on specified rule with alignment and padding.",
|
||||
"version": "0.3.0",
|
||||
"version": "0.3.1",
|
||||
"license": "MIT",
|
||||
"main": "CanvasTextWrapper.min.js",
|
||||
"homepage": "http://namniak.github.io/CanvasTextWrapper/",
|
||||
|
||||
Reference in New Issue
Block a user