mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
shift locking 22.5 degree and move to constants (#1216)
* shift locking 22.5 degree and move to constants #1171 * review SHIFT_LOCKING_ANGLE
This commit is contained in:
parent
44f871de71
commit
030954badb
4 changed files with 62 additions and 6 deletions
|
@ -100,6 +100,7 @@ import {
|
|||
DRAGGING_THRESHOLD,
|
||||
TEXT_TO_CENTER_SNAP_THRESHOLD,
|
||||
ARROW_CONFIRM_THRESHOLD,
|
||||
SHIFT_LOCKING_ANGLE,
|
||||
} from "../constants";
|
||||
import { LayerUI } from "./LayerUI";
|
||||
import { ScrollBars } from "../scene/types";
|
||||
|
@ -2257,8 +2258,8 @@ export class App extends React.Component<any, AppState> {
|
|||
const cy = (y1 + y2) / 2;
|
||||
let angle = (5 * Math.PI) / 2 + Math.atan2(y - cy, x - cx);
|
||||
if (event.shiftKey) {
|
||||
angle += Math.PI / 16;
|
||||
angle -= angle % (Math.PI / 8);
|
||||
angle += SHIFT_LOCKING_ANGLE / 2;
|
||||
angle -= angle % SHIFT_LOCKING_ANGLE;
|
||||
}
|
||||
if (angle >= 2 * Math.PI) {
|
||||
angle -= 2 * Math.PI;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue