fix transform handles regression (#2018)

This commit is contained in:
David Luzar 2020-08-10 15:00:21 +02:00 committed by GitHub
parent 950bcd0b72
commit 964746e569
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,7 @@ export const getTransformHandlesFromCoords = (
[x1, y1, x2, y2]: Bounds, [x1, y1, x2, y2]: Bounds,
angle: number, angle: number,
zoom: number, zoom: number,
pointerType: PointerType = "touch", pointerType: PointerType = "mouse",
omitSides: { [T in TransformHandleType]?: boolean } = {}, omitSides: { [T in TransformHandleType]?: boolean } = {},
): TransformHandles => { ): TransformHandles => {
const size = transformHandleSizes[pointerType]; const size = transformHandleSizes[pointerType];
@ -96,7 +96,7 @@ export const getTransformHandlesFromCoords = (
const dashedLineMargin = 4 / zoom; const dashedLineMargin = 4 / zoom;
const centeringOffset = 0; const centeringOffset = (size - 8) / (2 * zoom);
const transformHandles: TransformHandles = { const transformHandles: TransformHandles = {
nw: omitSides["nw"] nw: omitSides["nw"]
@ -217,7 +217,7 @@ export const getTransformHandlesFromCoords = (
export const getTransformHandles = ( export const getTransformHandles = (
element: ExcalidrawElement, element: ExcalidrawElement,
zoom: number, zoom: number,
pointerType: PointerType = "touch", pointerType: PointerType = "mouse",
): TransformHandles => { ): TransformHandles => {
let omitSides: { [T in TransformHandleType]?: boolean } = {}; let omitSides: { [T in TransformHandleType]?: boolean } = {};
if ( if (