Skip to content

Commit

Permalink
Merge pull request #65 from kkoomen/release
Browse files Browse the repository at this point in the history
v1.10.0
  • Loading branch information
kkoomen authored Jan 21, 2024
2 parents abb4efd + 6b8840a commit 82e1841
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pointless",
"version": "1.9.0",
"version": "1.10.0",
"private": true,
"description": "An endless drawing canvas.",
"dependencies": {
Expand Down
19 changes: 18 additions & 1 deletion src/components/Paper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,13 @@ class Paper extends React.Component {
canvasMouseDownHandler = (event) => {
if (this.isPanMode()) {
this.setState({ isPanning: true });
} else if (event.button === 1) {
// pan with middle mouse button
this.setState({
prevMode: this.state.mode,
mode: MODE.PAN,
isPanning: true,
});
} else if (this.isEraseMode()) {
this.setState({
isErasing: true,
Expand Down Expand Up @@ -808,7 +815,17 @@ class Paper extends React.Component {

canvasMouseUpHandler = (event) => {
if (this.isPanMode()) {
this.setState({ isPanning: false });
if (event.button === 1) {
// User was panning with the middle mouse button, therefore we want to
// immediately go back to the previous mode.
this.setState({
isPanning: false,
prevMode: this.state.mode,
mode: this.state.prevMode,
});
} else {
this.setState({ isPanning: false });
}
} else if (this.isEraseMode()) {
// No shapes got removed, so remove the unused history item.
let history = this.state.history;
Expand Down

0 comments on commit 82e1841

Please sign in to comment.