Skip to content

Commit e7702bc

Browse files
author
sven.wagnerboysen
committed
consider rotation of labels in word wrapping
git-svn-id: http://oryx-editor.googlecode.com/svn/branches/prod@3446 d672c736-503d-0410-a38a-9366997c882b
1 parent 8c98e5d commit e7702bc

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

.classpath

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@
127127
<classpathentry kind="lib" path="editor/lib/activation.jar"/>
128128
<classpathentry kind="lib" path="editor/lib/mail.jar"/>
129129
<classpathentry kind="lib" path="editor/lib/SuperCSV-1.52.jar"/>
130-
<classpathentry kind="lib" path="editor/lib/bpmnq-1.0.3-SNAPSHOT.jar"/>
131130
<classpathentry kind="lib" path="editor/lib/jaxb-api.jar"/>
132131
<classpathentry kind="lib" path="editor/lib/jaxb-impl.jar"/>
133132
<classpathentry kind="lib" path="editor/lib/jaxb-xjc.jar"/>

editor/client/scripts/Core/SVG/label.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,14 @@ ORYX.Core.SVG.Label = Clazz.extend({
322322

323323
var textLength = this._getRenderedTextLength(tspan, undefined, undefined, fontSize);
324324

325-
if (textLength > refbb.width) {
325+
/* Depending on the rotation of the text element, take
326+
* the width or height as reference respectively. */
327+
var refBoxLength = (this._rotate != 0
328+
&& this._rotate % 180 != 0
329+
&& this._rotate % 90 == 0 ?
330+
refbb.height : refbb.width);
331+
332+
if (textLength > refBoxLength) {
326333

327334
var startIndex = 0;
328335
var lastSeperatorIndex = 0;
@@ -331,7 +338,7 @@ ORYX.Core.SVG.Label = Clazz.extend({
331338
for (var i = 0; i < numOfChars; i++) {
332339
var sslength = this._getRenderedTextLength(tspan, startIndex, i-startIndex, fontSize);
333340

334-
if (sslength > refbb.width - 2) {
341+
if (sslength > refBoxLength - 2) {
335342
var newtspan = this.node.ownerDocument.createElementNS(ORYX.CONFIG.NAMESPACE_SVG, 'tspan');
336343
if (lastSeperatorIndex <= startIndex) {
337344
lastSeperatorIndex = (i == 0) ? i : i-1;

editor/data/stencilsets/bpmn2.0/view/swimlane/lane.svg

+1
Loading

editor/data/stencilsets/bpmn2.0/view/swimlane/pool.svg

+1-1
Loading

0 commit comments

Comments
 (0)