mirror of
https://github.com/wassname/CanvasTextWrapper.git
synced 2026-09-09 11:13:15 +08:00
fixing options
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
(function (root) {
|
(function (root) {
|
||||||
|
|
||||||
function CanvasTextWrapper(canvas, text, opts) {
|
function CanvasTextWrapper(canvas, text, options) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var defaults = {
|
var defaults = {
|
||||||
@@ -25,11 +25,11 @@
|
|||||||
strokeText: false // text is stroked according to context configuration
|
strokeText: false // text is stroked according to context configuration
|
||||||
};
|
};
|
||||||
|
|
||||||
opts = opts || {};
|
var opts = {};
|
||||||
|
|
||||||
for (var property in defaults) {
|
for (var property in defaults) {
|
||||||
if (defaults.hasOwnProperty(property)) {
|
if (defaults.hasOwnProperty(property)) {
|
||||||
opts[property] = (opts && opts[property]) ? opts[property] : defaults[property];
|
opts[property] = (options && options[property]) ? options[property] : defaults[property];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user