Fix right click on background not coming through (fix #13)
This commit is contained in:
parent
ea33f8782d
commit
dd7d64b725
|
@ -28,9 +28,6 @@ class GraphView extends GraphViewBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.assign(this, {
|
Object.assign(this, {
|
||||||
_super_renderBackground: this.renderBackground,
|
|
||||||
renderBackground: this.constructor.prototype.renderBackground.bind(this),
|
|
||||||
|
|
||||||
_super_handleZoomStart: this.handleZoomStart,
|
_super_handleZoomStart: this.handleZoomStart,
|
||||||
handleZoomStart: this.constructor.prototype.handleZoomStart.bind(this),
|
handleZoomStart: this.constructor.prototype.handleZoomStart.bind(this),
|
||||||
_super_handleZoomEnd: this.handleZoomEnd,
|
_super_handleZoomEnd: this.handleZoomEnd,
|
||||||
|
@ -146,19 +143,6 @@ class GraphView extends GraphViewBase {
|
||||||
return super.getMouseCoordinates();
|
return super.getMouseCoordinates();
|
||||||
}
|
}
|
||||||
|
|
||||||
renderBackground() {
|
|
||||||
const { gridSize, backgroundFillId, renderBackground, onBackgroundMouseDown } = this.props;
|
|
||||||
if (renderBackground) {
|
|
||||||
return renderBackground({
|
|
||||||
gridSize,
|
|
||||||
backgroundFillId,
|
|
||||||
onMouseDown: onBackgroundMouseDown,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return this._super_renderBackground();
|
|
||||||
}
|
|
||||||
|
|
||||||
getNodeComponent(id, node) {
|
getNodeComponent(id, node) {
|
||||||
const { nodeTypes, nodeSubtypes, nodeSize, renderNode, renderNodeText, nodeKey } = this.props;
|
const { nodeTypes, nodeSubtypes, nodeSize, renderNode, renderNodeText, nodeKey } = this.props;
|
||||||
return r(Node, {
|
return r(Node, {
|
||||||
|
|
|
@ -756,6 +756,7 @@ class Graph extends React.PureComponent {
|
||||||
this._requestedIcons = new Set();
|
this._requestedIcons = new Set();
|
||||||
|
|
||||||
Object.assign(this, {
|
Object.assign(this, {
|
||||||
|
renderBackground: this.renderBackground.bind(this),
|
||||||
onBackgroundMouseDown: this.onBackgroundMouseDown.bind(this),
|
onBackgroundMouseDown: this.onBackgroundMouseDown.bind(this),
|
||||||
|
|
||||||
onZoomStart: this.onZoomStart.bind(this),
|
onZoomStart: this.onZoomStart.bind(this),
|
||||||
|
@ -1443,6 +1444,12 @@ class Graph extends React.PureComponent {
|
||||||
this.props.loadModule('module-null-sink', '');
|
this.props.loadModule('module-null-sink', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderBackground() {
|
||||||
|
return renderBackground({
|
||||||
|
onMouseDown: this.onBackgroundMouseDown,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { nodes, edges } = this.state;
|
const { nodes, edges } = this.state;
|
||||||
|
|
||||||
|
@ -1482,8 +1489,6 @@ class Graph extends React.PureComponent {
|
||||||
nodeSubtypes: {},
|
nodeSubtypes: {},
|
||||||
edgeTypes: {},
|
edgeTypes: {},
|
||||||
|
|
||||||
onBackgroundMouseDown: this.onBackgroundMouseDown,
|
|
||||||
|
|
||||||
onZoomStart: this.onZoomStart,
|
onZoomStart: this.onZoomStart,
|
||||||
onZoomEnd: this.onZoomEnd,
|
onZoomEnd: this.onZoomEnd,
|
||||||
|
|
||||||
|
@ -1508,7 +1513,7 @@ class Graph extends React.PureComponent {
|
||||||
|
|
||||||
layoutEngine,
|
layoutEngine,
|
||||||
|
|
||||||
renderBackground,
|
renderBackground: this.renderBackground,
|
||||||
|
|
||||||
renderDefs,
|
renderDefs,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user