Make vertical spacing more consistent

This commit is contained in:
David Evans 2017-11-22 18:24:33 +00:00
parent 587a6d7f26
commit 7b8af40a24
15 changed files with 17 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -29,6 +29,7 @@ define(['./BaseComponent'], (BaseComponent) => {
env.drawAgentLine(name, env.primaryY); env.drawAgentLine(name, env.primaryY);
env.agentInfos.get(name).currentRad = r; env.agentInfos.get(name).currentRad = r;
}); });
return env.primaryY + env.theme.actionMargin;
} }
} }

View File

@ -300,7 +300,10 @@ define([
'fill': 'transparent', 'fill': 'transparent',
}), clickable.firstChild); }), clickable.firstChild);
return y1 + arrowDip + env.theme.actionMargin; return y1 + Math.max(
arrowDip + env.theme.minActionMargin,
env.theme.actionMargin
);
} }
renderSimpleConnect({label, agentNames, options}, env) { renderSimpleConnect({label, agentNames, options}, env) {
@ -359,7 +362,10 @@ define([
'fill': 'transparent', 'fill': 'transparent',
}), clickable.firstChild); }), clickable.firstChild);
return y + arrowSpread + env.theme.actionMargin; return y + Math.max(
arrowSpread + env.theme.minActionMargin,
env.theme.actionMargin
);
} }
renderPre({label, agentNames, options}, env) { renderPre({label, agentNames, options}, env) {

View File

@ -93,12 +93,12 @@ defineDescribe('Sequence Integration', [
const content = getSimplifiedContent(renderer); const content = getSimplifiedContent(renderer);
expect(content).toContain( expect(content).toContain(
'<svg viewBox="-5 -5 82 47">' '<svg viewBox="-5 -5 82 56">'
); );
// Agent 1 // Agent 1
expect(content).toContain( expect(content).toContain(
'<line x1="20.5" y1="11" x2="20.5" y2="37" class="agent-1-line"' '<line x1="20.5" y1="11" x2="20.5" y2="46" class="agent-1-line"'
); );
expect(content).toContain( expect(content).toContain(
'<rect x="10" y="0" width="21" height="11"' '<rect x="10" y="0" width="21" height="11"'
@ -109,7 +109,7 @@ defineDescribe('Sequence Integration', [
// Agent 2 // Agent 2
expect(content).toContain( expect(content).toContain(
'<line x1="51.5" y1="11" x2="51.5" y2="37" class="agent-2-line"' '<line x1="51.5" y1="11" x2="51.5" y2="46" class="agent-2-line"'
); );
expect(content).toContain( expect(content).toContain(
'<rect x="41" y="0" width="21" height="11"' '<rect x="41" y="0" width="21" height="11"'
@ -120,10 +120,10 @@ defineDescribe('Sequence Integration', [
// Arrow // Arrow
expect(content).toContain( expect(content).toContain(
'<line x1="20.5" y1="19" x2="48.5" y2="19"' '<line x1="20.5" y1="26" x2="48.5" y2="26"'
); );
expect(content).toContain( expect(content).toContain(
'<polygon points="46 14 51 19 46 24"' '<polygon points="46 21 51 26 46 31"'
); );
}); });

View File

@ -7,7 +7,8 @@ define(['core/ArrayUtilities', 'svg/SVGShapes'], (array, SVGShapes) => {
titleMargin: 10, titleMargin: 10,
outerMargin: 5, outerMargin: 5,
agentMargin: 10, agentMargin: 10,
actionMargin: 3, actionMargin: 10,
minActionMargin: 3,
agentLineHighlightRadius: 4, agentLineHighlightRadius: 4,
agentCap: { agentCap: {

View File

@ -8,6 +8,7 @@ define(['core/ArrayUtilities', 'svg/SVGShapes'], (array, SVGShapes) => {
outerMargin: 5, outerMargin: 5,
agentMargin: 8, agentMargin: 8,
actionMargin: 5, actionMargin: 5,
minActionMargin: 5,
agentLineHighlightRadius: 4, agentLineHighlightRadius: 4,
agentCap: { agentCap: {