Comparing version 1.10.0 to 1.11.0
@@ -146,6 +146,8 @@ # Xù - an MscGen super set | ||
(`wordwraparcs`), which is off by default. Text in any box | ||
(`note`, `box`, `rbox` and `abox`) always automatically wraps to fit into | ||
the box. | ||
(`note`, `box`, `rbox` and `abox`) or entity always automatically wraps | ||
to fit into the box. | ||
In addition Xù and MsGenny | ||
Both Xù and MsGenny have options to also switch that off - `wordwrapboxes` | ||
on false makes sure no text in any box gets wrapped. Likewise `wordwrapentities` | ||
on false makes sure no text in entities gets wrapped. | ||
@@ -152,0 +154,0 @@ ### title - for tool tips |
@@ -95,3 +95,3 @@ /* istanbul ignore else */ | ||
version: "1.10.0", | ||
version: "1.11.0", | ||
@@ -98,0 +98,0 @@ getAllowedValues: function() { |
{ | ||
"name": "mscgenjs", | ||
"version": "1.10.0", | ||
"version": "1.11.0", | ||
"description": "Implementation of MscGen in JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -298,9 +298,36 @@ /* istanbul ignore else */ | ||
function sizeEntityBoxToLabel(pLabel, pBBox) { | ||
var lLabelWidth = Math.min( | ||
svgutensils.getBBox(pLabel).width + (4 * constants.LINE_WIDTH), | ||
(pBBox.interEntitySpacing / 3) + pBBox.width | ||
); | ||
if (lLabelWidth >= pBBox.width) { | ||
pBBox.x -= (lLabelWidth - pBBox.width) / 2; | ||
pBBox.width = lLabelWidth; | ||
} | ||
return pBBox; | ||
} | ||
function renderEntity(pEntity, pX, pOptions) { | ||
var lGroup = svgelementfactory.createGroup(); | ||
var lBBox = entities.getDims(); | ||
var lBBox = _.cloneDeep(entities.getDims()); | ||
lBBox.x = pX ? pX : 0; | ||
var lLabel = renderlabels.createLabel( | ||
_.defaults( | ||
pEntity, | ||
{ | ||
kind: "entity" | ||
} | ||
), | ||
{ | ||
x:lBBox.x, | ||
y:lBBox.height / 2, | ||
width:lBBox.width | ||
}, | ||
pOptions | ||
); | ||
lGroup.appendChild( | ||
svgelementfactory.createRect( | ||
lBBox, | ||
sizeEntityBoxToLabel(lLabel, lBBox), | ||
"entity", | ||
@@ -311,18 +338,3 @@ pEntity.linecolor, | ||
); | ||
lGroup.appendChild( | ||
renderlabels.createLabel( | ||
_.defaults( | ||
pEntity, | ||
{ | ||
kind: "entity" | ||
} | ||
), | ||
{ | ||
x:lBBox.x, | ||
y:lBBox.height / 2, | ||
width:lBBox.width | ||
}, | ||
pOptions | ||
) | ||
); | ||
lGroup.appendChild(lLabel); | ||
return lGroup; | ||
@@ -329,0 +341,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
924666
19470