Skip to content

Commit 536846d

Browse files
author
SeungpilPark
committed
#8 wordWrap not work when maxwidth equals 1
1 parent fae9fd3 commit 536846d

5 files changed

Lines changed: 16 additions & 8 deletions

File tree

src/main/webapp/examples/develope.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,6 @@
165165
<script type="text/javascript" src="../src/shape/elec/Location.js"></script>
166166
<script type="text/javascript" src="../src/shape/elec/Manhole.js"></script>
167167

168-
<!--<script type="text/javascript" src="http://canvg.github.io/canvg/rgbcolor.js"></script>-->
169-
<!--<script type="text/javascript" src="http://canvg.github.io/canvg/StackBlur.js"></script>-->
170-
<!--<script type="text/javascript" src="http://canvg.github.io/canvg/canvg.js"></script>-->
171-
172168
<!--<script type="text/javascript" src="../src/worker/og-worker.js"></script>-->
173169

174170
<style type="text/css">

src/main/webapp/opengraph/OpenGraph-0.1.2-SNAPSHOT-All.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/opengraph/OpenGraph-0.1.2-SNAPSHOT-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/webapp/opengraph/OpenGraph-0.1.2-SNAPSHOT.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4486,6 +4486,12 @@ window.Raphael.svg && function (R) {
44864486
lines.push(text);
44874487
done = true;
44884488
} else {
4489+
// maxWidth 1인경우 처리
4490+
if(maxWidth == 1) {
4491+
lines.push(text);
4492+
done = true;
4493+
break;
4494+
}
44894495
// Inserts new line at first whitespace of the line
44904496
for (i = maxWidth - 1; i >= 0; i--) {
44914497
if (testWhite(text.charAt(i))) {
@@ -4500,7 +4506,7 @@ window.Raphael.svg && function (R) {
45004506
// Inserts new line at maxWidth position, the word is too long to wrap
45014507
if (!found) {
45024508
res = res + text.slice(0, maxWidth);
4503-
text = text.slice(maxWidth - 1);
4509+
text = text.slice(maxWidth);
45044510
lines.push(res);
45054511
}
45064512
}

src/main/webapp/src/raphael-2.1.0-custom.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4485,6 +4485,12 @@ window.Raphael.svg && function (R) {
44854485
lines.push(text);
44864486
done = true;
44874487
} else {
4488+
// maxWidth 1인경우 처리
4489+
if(maxWidth == 1) {
4490+
lines.push(text);
4491+
done = true;
4492+
break;
4493+
}
44884494
// Inserts new line at first whitespace of the line
44894495
for (i = maxWidth - 1; i >= 0; i--) {
44904496
if (testWhite(text.charAt(i))) {
@@ -4499,7 +4505,7 @@ window.Raphael.svg && function (R) {
44994505
// Inserts new line at maxWidth position, the word is too long to wrap
45004506
if (!found) {
45014507
res = res + text.slice(0, maxWidth);
4502-
text = text.slice(maxWidth - 1);
4508+
text = text.slice(maxWidth);
45034509
lines.push(res);
45044510
}
45054511
}

0 commit comments

Comments
 (0)