|
@@ -3944,7 +3944,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
const [gridX, gridY] = getGridPoint(
|
|
const [gridX, gridY] = getGridPoint(
|
|
scenePointerX,
|
|
scenePointerX,
|
|
scenePointerY,
|
|
scenePointerY,
|
|
- this.state.gridSize,
|
|
|
|
|
|
+ event[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
);
|
|
);
|
|
|
|
|
|
const [lastCommittedX, lastCommittedY] =
|
|
const [lastCommittedX, lastCommittedY] =
|
|
@@ -4761,7 +4761,11 @@ class App extends React.Component<AppProps, AppState> {
|
|
origin,
|
|
origin,
|
|
withCmdOrCtrl: event[KEYS.CTRL_OR_CMD],
|
|
withCmdOrCtrl: event[KEYS.CTRL_OR_CMD],
|
|
originInGrid: tupleToCoors(
|
|
originInGrid: tupleToCoors(
|
|
- getGridPoint(origin.x, origin.y, this.state.gridSize),
|
|
|
|
|
|
+ getGridPoint(
|
|
|
|
+ origin.x,
|
|
|
|
+ origin.y,
|
|
|
|
+ event[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
scrollbars: isOverScrollBars(
|
|
scrollbars: isOverScrollBars(
|
|
currentScrollBars,
|
|
currentScrollBars,
|
|
@@ -5285,7 +5289,11 @@ class App extends React.Component<AppProps, AppState> {
|
|
sceneY: number;
|
|
sceneY: number;
|
|
link: string;
|
|
link: string;
|
|
}) => {
|
|
}) => {
|
|
- const [gridX, gridY] = getGridPoint(sceneX, sceneY, this.state.gridSize);
|
|
|
|
|
|
+ const [gridX, gridY] = getGridPoint(
|
|
|
|
+ sceneX,
|
|
|
|
+ sceneY,
|
|
|
|
+ this.lastPointerDown?.[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
|
|
+ );
|
|
|
|
|
|
const embedLink = getEmbedLink(link);
|
|
const embedLink = getEmbedLink(link);
|
|
|
|
|
|
@@ -5331,7 +5339,11 @@ class App extends React.Component<AppProps, AppState> {
|
|
sceneX: number;
|
|
sceneX: number;
|
|
sceneY: number;
|
|
sceneY: number;
|
|
}) => {
|
|
}) => {
|
|
- const [gridX, gridY] = getGridPoint(sceneX, sceneY, this.state.gridSize);
|
|
|
|
|
|
+ const [gridX, gridY] = getGridPoint(
|
|
|
|
+ sceneX,
|
|
|
|
+ sceneY,
|
|
|
|
+ this.lastPointerDown?.[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
|
|
+ );
|
|
|
|
|
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
x: gridX,
|
|
x: gridX,
|
|
@@ -5414,7 +5426,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
const [gridX, gridY] = getGridPoint(
|
|
const [gridX, gridY] = getGridPoint(
|
|
pointerDownState.origin.x,
|
|
pointerDownState.origin.x,
|
|
pointerDownState.origin.y,
|
|
pointerDownState.origin.y,
|
|
- this.state.gridSize,
|
|
|
|
|
|
+ event[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
);
|
|
);
|
|
|
|
|
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
@@ -5507,7 +5519,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
const [gridX, gridY] = getGridPoint(
|
|
const [gridX, gridY] = getGridPoint(
|
|
pointerDownState.origin.x,
|
|
pointerDownState.origin.x,
|
|
pointerDownState.origin.y,
|
|
pointerDownState.origin.y,
|
|
- this.state.gridSize,
|
|
|
|
|
|
+ this.lastPointerDown?.[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
);
|
|
);
|
|
|
|
|
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
const topLayerFrame = this.getTopLayerFrameAtSceneCoords({
|
|
@@ -5565,7 +5577,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
const [gridX, gridY] = getGridPoint(
|
|
const [gridX, gridY] = getGridPoint(
|
|
pointerDownState.origin.x,
|
|
pointerDownState.origin.x,
|
|
pointerDownState.origin.y,
|
|
pointerDownState.origin.y,
|
|
- this.state.gridSize,
|
|
|
|
|
|
+ this.lastPointerDown?.[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
);
|
|
);
|
|
|
|
|
|
const frame = newFrameElement({
|
|
const frame = newFrameElement({
|
|
@@ -5648,7 +5660,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
const [gridX, gridY] = getGridPoint(
|
|
const [gridX, gridY] = getGridPoint(
|
|
pointerCoords.x,
|
|
pointerCoords.x,
|
|
pointerCoords.y,
|
|
pointerCoords.y,
|
|
- this.state.gridSize,
|
|
|
|
|
|
+ event[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
);
|
|
);
|
|
|
|
|
|
// for arrows/lines, don't start dragging until a given threshold
|
|
// for arrows/lines, don't start dragging until a given threshold
|
|
@@ -5694,6 +5706,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
this.state.selectedLinearElement,
|
|
this.state.selectedLinearElement,
|
|
pointerCoords,
|
|
pointerCoords,
|
|
this.state,
|
|
this.state,
|
|
|
|
+ !event[KEYS.CTRL_OR_CMD],
|
|
);
|
|
);
|
|
if (!ret) {
|
|
if (!ret) {
|
|
return;
|
|
return;
|
|
@@ -5819,7 +5832,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
const [dragX, dragY] = getGridPoint(
|
|
const [dragX, dragY] = getGridPoint(
|
|
pointerCoords.x - pointerDownState.drag.offset.x,
|
|
pointerCoords.x - pointerDownState.drag.offset.x,
|
|
pointerCoords.y - pointerDownState.drag.offset.y,
|
|
pointerCoords.y - pointerDownState.drag.offset.y,
|
|
- this.state.gridSize,
|
|
|
|
|
|
+ event[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
);
|
|
);
|
|
|
|
|
|
const [dragDistanceX, dragDistanceY] = [
|
|
const [dragDistanceX, dragDistanceY] = [
|
|
@@ -5886,7 +5899,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
const [originDragX, originDragY] = getGridPoint(
|
|
const [originDragX, originDragY] = getGridPoint(
|
|
pointerDownState.origin.x - pointerDownState.drag.offset.x,
|
|
pointerDownState.origin.x - pointerDownState.drag.offset.x,
|
|
pointerDownState.origin.y - pointerDownState.drag.offset.y,
|
|
pointerDownState.origin.y - pointerDownState.drag.offset.y,
|
|
- this.state.gridSize,
|
|
|
|
|
|
+ event[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
);
|
|
);
|
|
mutateElement(duplicatedElement, {
|
|
mutateElement(duplicatedElement, {
|
|
x: duplicatedElement.x + (originDragX - dragX),
|
|
x: duplicatedElement.x + (originDragX - dragX),
|
|
@@ -7679,7 +7692,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
const [gridX, gridY] = getGridPoint(
|
|
const [gridX, gridY] = getGridPoint(
|
|
pointerCoords.x,
|
|
pointerCoords.x,
|
|
pointerCoords.y,
|
|
pointerCoords.y,
|
|
- this.state.gridSize,
|
|
|
|
|
|
+ event[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
);
|
|
);
|
|
|
|
|
|
const image =
|
|
const image =
|
|
@@ -7748,7 +7761,7 @@ class App extends React.Component<AppProps, AppState> {
|
|
const [resizeX, resizeY] = getGridPoint(
|
|
const [resizeX, resizeY] = getGridPoint(
|
|
pointerCoords.x - pointerDownState.resize.offset.x,
|
|
pointerCoords.x - pointerDownState.resize.offset.x,
|
|
pointerCoords.y - pointerDownState.resize.offset.y,
|
|
pointerCoords.y - pointerDownState.resize.offset.y,
|
|
- this.state.gridSize,
|
|
|
|
|
|
+ event[KEYS.CTRL_OR_CMD] ? null : this.state.gridSize,
|
|
);
|
|
);
|
|
|
|
|
|
const frameElementsOffsetsMap = new Map<
|
|
const frameElementsOffsetsMap = new Map<
|