bpmn-visualization-js icon indicating copy to clipboard operation
bpmn-visualization-js copied to clipboard

[FEAT] Add padding/margin to the default Badge Overlay

Open tbouffard opened this issue 4 years ago • 2 comments

Is your feature request related to a problem? Please describe. The current default badge displays the overlay text to close from the border. This is particularly visible with the default white fill and black stroke colors. This would be less visible with alternate colors, especially if the fill and stroke colors were the same (#1172)

01_default_colors_01_current

02_chartreuse_colors_01_current

Describe the solution you'd like Set default padding/margin to add more spaces between the text and the border. Desicion of making the value configurable is deferred to #1172

This would look like the following when applied to the 2 previous examples

01_default_colors_02_padding_proposal

02_chartreuse_colors_02_padding_proposal

tbouffard avatar Mar 30 '21 05:03 tbouffard

that's exactly what I meant. Thanks.

NathalieC avatar Mar 30 '21 07:03 NathalieC

it seems that in mxSvgCanvas2D.prototype.addTextBackground method (which is used for adding the background for the node for mxText shape) there is no use of spacing - some magic number '2' appears (it can be modified to add missing right padding)

	n.setAttribute('width', Math.ceil(bbox.width + 2));
	n.setAttribute('height', Math.ceil(bbox.height));

aibcmars avatar Apr 29 '21 15:04 aibcmars