Skip to content

Commit

Permalink
move viewport when pressing alt and moving mouse
Browse files Browse the repository at this point in the history
  • Loading branch information
philippotto committed Mar 26, 2019
1 parent 9bedea7 commit 1d10247
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,12 @@ class PlaneController extends React.PureComponent<Props> {
Store.dispatch(setViewportAction(planeId));
},
pinch: delta => this.zoom(delta, true),
mouseMove: (delta: Point2, position: Point2) => {
Store.dispatch(setMousePositionAction([position.x, position.y]));
mouseMove: (delta: Point2, position: Point2, id, event) => {
if (event.altKey) {
this.movePlane([-delta.x, -delta.y, 0]);
} else {
Store.dispatch(setMousePositionAction([position.x, position.y]));
}
},
};
// TODO: Find a nicer way to express this, while satisfying flow
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1363,7 +1363,7 @@ acorn-walk@^6.0.1:
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913"
integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==

acorn@^5.2.1, acorn@^5.5.3, acorn@^5.6.2:
acorn@^5.0.0, acorn@^5.2.1, acorn@^5.5.3, acorn@^5.6.2:
version "5.7.3"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279"
integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==
Expand Down Expand Up @@ -10558,7 +10558,7 @@ scheduler@^0.13.3:
loose-envify "^1.1.0"
object-assign "^4.1.1"

schema-utils@^0.4.0, schema-utils@^0.4.5:
schema-utils@^0.4.0, schema-utils@^0.4.4, schema-utils@^0.4.5:
version "0.4.7"
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.4.7.tgz#ba74f597d2be2ea880131746ee17d0a093c68187"
integrity sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==
Expand Down

0 comments on commit 1d10247

Please sign in to comment.