Zoom on cursor | Issue #940 (#2319)

This commit is contained in:
João Forja
2020-11-04 17:49:15 +00:00
committed by GitHub
parent facde7ace0
commit 566e6a5ede
24 changed files with 912 additions and 357 deletions

View File

@@ -44,7 +44,7 @@ export const hitTest = (
y: number,
): boolean => {
// How many pixels off the shape boundary we still consider a hit
const threshold = 10 / appState.zoom;
const threshold = 10 / appState.zoom.value;
const point: Point = [x, y];
if (isElementSelected(appState, element)) {
@@ -60,7 +60,7 @@ export const isHittingElementBoundingBoxWithoutHittingElement = (
x: number,
y: number,
): boolean => {
const threshold = 10 / appState.zoom;
const threshold = 10 / appState.zoom.value;
return (
!isHittingElementNotConsideringBoundingBox(element, appState, [x, y]) &&
@@ -73,7 +73,7 @@ const isHittingElementNotConsideringBoundingBox = (
appState: AppState,
point: Point,
): boolean => {
const threshold = 10 / appState.zoom;
const threshold = 10 / appState.zoom.value;
const check =
element.type === "text"