mirror of
https://github.com/wassname/CanvasTextWrapper.git
synced 2026-06-27 18:21:38 +08:00
fixed 1st example
This commit is contained in:
@@ -1,10 +1,3 @@
|
||||
/*! CanvasTextWrapper
|
||||
* https://github.com/namniak/CanvasTextWrapper
|
||||
* Version: 0.4.0
|
||||
* MIT License (http://www.opensource.org/licenses/mit-license.html)
|
||||
*/
|
||||
|
||||
|
||||
(function (root) {
|
||||
|
||||
function CanvasTextWrapper(canvas, text, options) {
|
||||
@@ -73,6 +66,7 @@
|
||||
|
||||
setFont(--fontSize);
|
||||
lineHeight = fontSize;
|
||||
wrap();
|
||||
} else {
|
||||
wrap();
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ document.onreadystatechange = function() {
|
||||
canvas.width = w;
|
||||
canvas.height = h;
|
||||
context = canvas.getContext('2d');
|
||||
context.lineWidth = 2;
|
||||
context.lineWidth = 1;
|
||||
context.strokeStyle = 'yellow';
|
||||
CanvasTextWrapper(canvas,(options[i].txt),options[i]);
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
var model = [
|
||||
{
|
||||
txt: 'Break text on every next word',
|
||||
font: 'italic 800 36px Arial, sans-serif',
|
||||
font: 'italic 800 25px Arial, sans-serif',
|
||||
textAlign: 'center',
|
||||
lineBreak: 'word',
|
||||
lineHeight: "160%"
|
||||
|
||||
Reference in New Issue
Block a user