Skip to content

Commit

Permalink
解决Diagram viewer不显示线上文字问题
Browse files Browse the repository at this point in the history
  • Loading branch information
henryyan committed Jul 23, 2014
1 parent 3e07303 commit b906dc6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/webapp/diagram-viewer/js/ProcessDiagramCanvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,19 @@ ProcessDiagramCanvas.prototype = {
if (conditional) {
conditionalSequenceFlowIndicator = this._drawConditionalSequenceFlowIndicator(firstLine);
}

// draw flow name
var flowName = contextObject.name;
if (flowName) {
var xPointArray = contextObject.xPointArray;
var yPointArray = contextObject.yPointArray;
var textX = xPointArray[0] < xPointArray[1] ? xPointArray[0] : xPointArray[1];
var textY = yPointArray[0] < yPointArray[1] ? yPointArray[1] : yPointArray[0];
// fix xy
textX += 20;
textY -= 10;
this.g.text(textX, textY, flowName).attr(LABEL_FONT);
}

var st = this.g.set();
st.push(polyline.element, arrowHead, circleTail, conditionalSequenceFlowIndicator);
Expand Down

0 comments on commit b906dc6

Please sign in to comment.