Addressed small @foot's comments.

This commit is contained in:
Filip Barl
2017-08-23 16:41:17 +02:00
parent a51d34f1e5
commit 065c2b11d6

View File

@@ -162,7 +162,7 @@ class ZoomableCanvas extends React.Component {
}
handlePan() {
let state = { ...this.state };
let state = this.state;
// Apply the translation respecting the boundaries.
state = this.clampedTranslation({ ...state,
translateX: this.state.translateX + d3Event.dx,
@@ -181,6 +181,7 @@ class ZoomableCanvas extends React.Component {
};
this.zoomAtPositionByFactor(mousePosition, zoomFactor(ev));
}
ev.preventDefault();
}
clampedTranslation(state) {