Skip to content

Commit

Permalink
Merge pull request #170 from entrylabs/issue/list-19
Browse files Browse the repository at this point in the history
Issue/list 19
  • Loading branch information
chanlee committed Feb 5, 2016
2 parents bcd3cdf + 487c654 commit 3f93816
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 30 deletions.
15 changes: 2 additions & 13 deletions dist/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -7235,20 +7235,9 @@ Entry.EntryObject.prototype.initEntity = function(a) {
b.height = c.height;
} else {
if ("textBox" == this.objectType) {
if (b.regX = 25, b.regY = 12, b.scaleX = b.scaleY = 1.5, b.width = 50, b.height = 24, b.text = a.name, a.options) {
if (b.regX = 25, b.regY = 12, b.scaleX = b.scaleY = 1.5, b.width = 50, b.height = 24, b.text = a.text, a.options) {
if (a = a.options, c = "", a.bold && (c += "bold "), a.italic && (c += "italic "), b.underline = a.underline, b.strike = a.strike, b.font = c + "20px " + a.font.family, b.colour = a.colour, b.bgColor = a.background, b.lineBreak = a.lineBreak) {
a = b.text.split("\n");
if (1 < a.length) {
for (var c = a[0].length, d = 1, e = a.length;d < e;d++) {
a[d].length > c && (c = a[d].length);
}
b.width = 25 * c;
b.height = 24 * a.length;
} else {
b.width = 25 * b.text.length;
}
b.regX = b.width / 2;
b.regY = b.height / 2;
b.width = 256, b.height = .5625 * b.width, b.regX = b.width / 2, b.regY = b.height / 2;
}
} else {
b.underline = !1, b.strike = !1, b.font = "20px Nanum Gothic", b.colour = "#000000", b.bgColor = "#ffffff";
Expand Down
6 changes: 3 additions & 3 deletions dist/entry.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 3 additions & 14 deletions src/object.js
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ Entry.EntryObject.prototype.initEntity = function(model) {
json.scaleX = json.scaleY = 1.5;
json.width = 50;
json.height = 24;
json.text = model.name;
json.text = model.text;
if (model.options) {
var options = model.options;
var fontStyle = '';
Expand All @@ -867,19 +867,8 @@ Entry.EntryObject.prototype.initEntity = function(model) {
json.bgColor = options.background;
json.lineBreak = options.lineBreak;
if (options.lineBreak) {
var lines = json.text.split('\n');
if (lines.length > 1) {
var maxLen = lines[0].length;
for(var i=1,len=lines.length;i<len;i++) {
if (lines[i].length > maxLen) {
maxLen = lines[i].length;
}
}
json.width = 25 * maxLen;
json.height = 24 * lines.length;
} else {
json.width = 25 * json.text.length;
}
json.width = 256;
json.height = json.width * 0.5625;
json.regX = json.width / 2;
json.regY = json.height / 2;
}
Expand Down

0 comments on commit 3f93816

Please sign in to comment.