Skip to content

Commit bab987b

Browse files
committed
fix text calculation
1 parent df5ddb3 commit bab987b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/vector/Text.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1579,7 +1579,8 @@ acgraph.vector.Text.prototype.finalizeTextLine = function() {
15791579
segment = goog.array.peek(this.currentLine_);
15801580
var segment_bounds = this.getTextBounds(segment.text, segment.getStyle());
15811581

1582-
var cutPos = this.cutTextSegment_(segment.text, segment.getStyle(), 0, this.textWidthLimit, segment_bounds, true);
1582+
var cutLimit = this.textWidthLimit - (this.currentLineWidth_ - segment_bounds.width);
1583+
var cutPos = this.cutTextSegment_(segment.text, segment.getStyle(), 0, cutLimit, segment_bounds, true);
15831584
var cutText = segment.text.substring(0, cutPos);
15841585
segment_bounds = this.getTextBounds(cutText, segment.getStyle());
15851586
segment.text = cutText;

0 commit comments

Comments
 (0)