Skip to content

Commit a47c2e0

Browse files
author
maeda-m
committed
Fixed some problems in new layout schema
1 parent 3639ddd commit a47c2e0

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

src/app/core/abstracttextgroup.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ thin.core.AbstractTextGroup.prototype.setTextLineHeightRatio = function(ratio) {
148148
thin.core.AbstractTextGroup.prototype.setKerning = function(spacing) {
149149
var layout = this.getLayout();
150150
var element = this.getElement();
151+
152+
if (isNaN(Number(spacing))) {
153+
spacing = thin.core.TextStyle.DEFAULT_KERNING;
154+
}
155+
151156
if (thin.isExactlyEqual(spacing, thin.core.TextStyle.DEFAULT_KERNING)) {
152157
layout.setElementAttributes(element, {
153158
'kerning': thin.core.TextStyle.DEFAULT_ELEMENT_KERNING,

src/app/core/pagenumbershape.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ thin.core.PageNumberShape.prototype.toHash = function() {
848848

849849
goog.object.extend(hash, {
850850
'format': this.getFormat(),
851-
'target': this.getTargetId() || 'report'
851+
'target': this.getTargetId()
852852
});
853853

854854
var style = goog.object.clone(hash['style']);
@@ -879,9 +879,7 @@ thin.core.PageNumberShape.prototype.update = function(attrs) {
879879
this.setFormat(value);
880880
break;
881881
case 'target':
882-
if (!thin.isExactlyEqual('report', value)){
883-
this.setTargetId(value);
884-
}
882+
this.setTargetId(value);
885883
break;
886884
case 'overflow':
887885
this.setOverflowType(value);

src/app/core/tblockshape.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ thin.core.TblockShape.prototype.toHash = function() {
17971797
goog.object.extend(hash, {
17981798
'reference-id': this.getRefId(),
17991799
'value': this.getDefaultValueOfLink(),
1800-
'mulitple-line': this.isMultiMode(),
1800+
'multiple-line': this.isMultiMode(),
18011801
'format': format
18021802
});
18031803

@@ -1814,6 +1814,12 @@ thin.core.TblockShape.prototype.toHash = function() {
18141814
* @param {Object} attrs
18151815
*/
18161816
thin.core.TblockShape.prototype.update = function(attrs) {
1817+
if (goog.object.containsKey(attrs, 'style')) {
1818+
var isMultiple = goog.object.get(attrs,
1819+
'multiple-line', thin.core.TblockShape.DEFAULT_MULTIPLE);
1820+
this.setMultiMode(isMultiple);
1821+
}
1822+
18171823
goog.base(this, 'update', attrs);
18181824

18191825
goog.object.forEach(attrs, function(value, attr) {
@@ -1849,9 +1855,6 @@ thin.core.TblockShape.prototype.update = function(attrs) {
18491855
case 'value':
18501856
this.setDefaultValueOfLink(value);
18511857
break;
1852-
case 'mulitple-line':
1853-
this.setMultiMode(value);
1854-
break;
18551858
case 'overflow':
18561859
this.setOverflowType(value);
18571860
break;

0 commit comments

Comments
 (0)