David Benson 2020-11-11 12:51:18 +00:00 committed by GitHub
parent a5ac1ab175
commit c85074e6b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 28 deletions

View File

@ -218,19 +218,10 @@
{ {
// Scrollbars are on the div // Scrollbars are on the div
var s = graph.view.scale; var s = graph.view.scale;
state.text.node.style.overflow = 'hidden'; var div = state.text.node.getElementsByTagName('div')[2];
var div = state.text.node.getElementsByTagName('div')[0];
if (div != null) if (div != null)
{ {
// Adds height of the title table cell
var oh = 26;
div.style.display = 'block';
div.style.top = oh + 'px';
div.style.width = Math.max(1, Math.round(state.width / s)) + 'px';
div.style.height = Math.max(1, Math.round((state.height / s) - oh)) + 'px';
// Installs the handler for updating connected edges // Installs the handler for updating connected edges
if (div.scrollHandler == null) if (div.scrollHandler == null)
{ {
@ -376,7 +367,7 @@
return '<table style="overflow:hidden;" width="100%" border="1" cellpadding="4" class="title">' + return '<table style="overflow:hidden;" width="100%" border="1" cellpadding="4" class="title">' +
'<tr><th colspan="2">Customers</th></tr>' + '<tr><th colspan="2">Customers</th></tr>' +
'</table>'+ '</table>'+
'<div style="overflow:auto;cursor:default;">'+ '<div style="overflow:auto;cursor:default;top:26px;bottom:0px;position:absolute;width:100%;">'+
'<table width="100%" height="100%" border="1" cellpadding="4" class="erd">' + '<table width="100%" height="100%" border="1" cellpadding="4" class="erd">' +
'<tr><td>' + '<tr><td>' +
'<img align="center" src="images/key.png"/>' + '<img align="center" src="images/key.png"/>' +
@ -416,24 +407,17 @@
// Adds cells to the model in a single step // Adds cells to the model in a single step
var width = 160; var width = 160;
var height = 230;
graph.getModel().beginUpdate(); graph.getModel().beginUpdate();
try try
{ {
var v1 = graph.insertVertex(parent, null, '', 20, 20, width, 0); var v1 = graph.insertVertex(parent, null, '', 20, 20, width, height);
var v2 = graph.insertVertex(parent, null, '', 400, 150, width, 0); v1.geometry.alternateBounds = new mxRectangle(0, 0, width, 26);
var e1 = graph.insertEdge(parent, null, relation, v1, v2);
// Updates the height of the cell (override width var v2 = graph.insertVertex(parent, null, '', 400, 150, width, height);
// for table width is set to 100%) v2.geometry.alternateBounds = new mxRectangle(0, 0, width, 26);
graph.updateCellSize(v1);
v1.geometry.width = width;
v1.geometry.alternateBounds = new mxRectangle(0, 0, width, 27);
// Updates the height of the cell (override width graph.insertEdge(parent, null, relation, v1, v2);
// for table width is set to 100%)
graph.updateCellSize(v2);
v2.geometry.width = width;
v2.geometry.alternateBounds = new mxRectangle(0, 0, width, 27);
} }
finally finally
{ {
@ -459,7 +443,7 @@
mxGraphView.prototype.updateFloatingTerminalPoint = function(edge, start, end, source) mxGraphView.prototype.updateFloatingTerminalPoint = function(edge, start, end, source)
{ {
var next = this.getNextPoint(edge, end, source); var next = this.getNextPoint(edge, end, source);
var div = start.text.node.getElementsByTagName('div')[0]; var div = start.text.node.getElementsByTagName('div')[2];
var x = start.x; var x = start.x;
var y = start.getCenterY(); var y = start.getCenterY();