Skip to content

Commit

Permalink
22.0.1 release
Browse files Browse the repository at this point in the history
  • Loading branch information
davidjgraph committed Oct 2, 2023
1 parent 8906f90 commit 4bf5ba6
Show file tree
Hide file tree
Showing 24 changed files with 14,950 additions and 5,644 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
02-OCT-2023: 22.0.1

- Ignores selection for nested cells with part style
- Adds salesforce icons [drawio-2793]

28-SEP-2023: 22.0.0

- Adds DRAWIO_SERVER_URL as an additional URL to DRAWIO_BASE_URL. BASE_URL used to indicate
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.0.0
22.0.1
1 change: 1 addition & 0 deletions etc/build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
<file name="Sidebar-Office.js" />
<file name="Sidebar-PID.js" />
<file name="Sidebar-Rack.js" />
<file name="Sidebar-Salesforce.js" />
<file name="Sidebar-Signs.js" />
<file name="Sidebar-Sitemap.js" />
<file name="Sidebar-Sysml.js" />
Expand Down
67 changes: 56 additions & 11 deletions src/main/mxgraph/handler/mxGraphHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,7 @@ mxGraphHandler.prototype.getInitialCellForEvent = function(me)
var state = me.getState();

if ((!this.graph.isToggleEvent(me.getEvent()) || !mxEvent.isAltDown(me.getEvent())) &&
state != null && (!this.graph.isCellSelected(state.cell) ||
this.graph.isPart(state.cell)))
state != null && !this.graph.isCellSelected(state.cell))
{
var model = this.graph.model;
var next = this.graph.view.getState(model.getParent(state.cell));
Expand Down Expand Up @@ -509,7 +508,7 @@ mxGraphHandler.prototype.selectDelayed = function(me)
if (!this.graph.popupMenuHandler.isPopupTrigger(me))
{
var cell = me.getCell();

if (cell == null)
{
cell = this.cell;
Expand Down Expand Up @@ -675,15 +674,51 @@ mxGraphHandler.prototype.getGuideStates = function()
*
* initialCell - <mxCell> that triggered this handler.
*/
mxGraphHandler.prototype.getCells = function(initialCell)
mxGraphHandler.prototype.getCells = function(initialCell, cells)
{
if (!this.delayedSelection && this.graph.isCellMovable(initialCell))
if (cells == null && !this.delayedSelection &&
this.graph.isCellMovable(initialCell))
{
return [initialCell];
return [this.graph.getCompositeParent(initialCell)];
}
else
{
return this.graph.getMovableCells(this.graph.getSelectionCells());
cells = (cells != null) ? cells : this.graph.getSelectionCells();
var dict = new mxDictionary();

// Gets composite parents
var comp = [];

for (var i = 0; i < cells.length; i++)
{
var cell = this.graph.getCompositeParent(cells[i]);

if (dict.get(cell) == null)
{
dict.put(cell, true);
comp.push(cell);
}
}

// Removes descendants
var result = [];

for (var i = 0; i < comp.length; i++)
{
var temp = this.graph.model.getParent(comp[i]);

while (dict.get(temp) == null && temp != null)
{
temp = this.graph.model.getParent(temp);
}

if (temp == null)
{
result.push(comp[i]);
}
}

return this.graph.getMovableCells(result);
}
};

Expand Down Expand Up @@ -1045,14 +1080,24 @@ mxGraphHandler.prototype.mouseMove = function(sender, me)
Math.abs(this.mouseDownY - me.getY()) > tol))
{
this.delayedSelection = false;
this.cellWasClicked = true;

if (!mxEvent.isAltDown(me.getEvent()))
if (!this.graph.isCellSelected(this.cell) &&
!mxEvent.isAltDown(me.getEvent()))
{
graph.addSelectionCell(this.cell);
if (this.graph.isToggleEvent(me.getEvent()))
{
graph.addSelectionCell(this.cell);
}
else
{
graph.setSelectionCell(this.cell);
}
}

this.start(this.cell, this.mouseDownX, this.mouseDownY,
graph.getMovableCells(graph.getSelectionCells()));
this.getCells(null, graph.getSelectionCells().
concat(me.getCell())));
}

var delta = (this.first != null) ? this.getDelta(me) : null;
Expand Down Expand Up @@ -1148,7 +1193,7 @@ mxGraphHandler.prototype.mouseMove = function(sender, me)
}
else
{
delta = this.graph.snapDelta(delta, this.bounds, !gridEnabled, false, false);
delta = graph.snapDelta(delta, this.bounds, !gridEnabled, false, false);
}

if (this.guide != null && hideGuide)
Expand Down
29 changes: 29 additions & 0 deletions src/main/mxgraph/shape/mxMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,33 @@ var mxMarker =

mxMarker.addMarker('diamond', diamond);
mxMarker.addMarker('diamondThin', diamond);

mxMarker.addMarker('manyOptional', function(c, shape, type, pe, unitX, unitY, size, source, sw, filled)
{
var nx = unitX * (size + sw + 1);
var ny = unitY * (size + sw + 1);
var a = size / 2;
var px = pe.x;
var py = pe.y;

pe.x -= 2 * nx - unitX * sw / 2;
pe.y -= 2 * ny - unitY * sw / 2;

return function()
{
c.begin();
c.ellipse(px - 1.5 * nx - a, py - 1.5 * ny - a, 2 * a, 2 * a);
filled ? c.fillAndStroke() : c.stroke();

c.begin();
c.moveTo(px, py);
c.lineTo(px - nx, py - ny);

c.moveTo(px + ny / 2, py - nx / 2);
c.lineTo(px - nx, py - ny);
c.lineTo(px - ny / 2, py + nx / 2);

c.stroke();
};
});
})();
27 changes: 27 additions & 0 deletions src/main/mxgraph/util/mxUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,33 @@ var mxUtils =
return -1;
},

/**
* Function: lastIndexOf
*
* Returns the last index of obj in array or -1 if the array does not contain
* the given object.
*
* Parameters:
*
* array - Array to check for the given obj.
* obj - Object to find in the given array.
*/
lastIndexOf: function(array, obj)
{
if (array != null && obj != null)
{
for (var i = array.length - 1; i >= 0; i--)
{
if (array[i] == obj)
{
return i;
}
}
}

return -1;
},

/**
* Function: forEach
*
Expand Down
Binary file added src/main/webapp/images/sidebar-salesforce.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4bf5ba6

Please sign in to comment.