From 5493afd38495273f47827fbdd80bc653610d14b7 Mon Sep 17 00:00:00 2001 From: Ella Date: Mon, 2 Dec 2024 12:36:39 +0100 Subject: [PATCH] 200px max --- .../use-block-props/use-selected-block-event-handlers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/block-list/use-block-props/use-selected-block-event-handlers.js b/packages/block-editor/src/components/block-list/use-block-props/use-selected-block-event-handlers.js index 3afaeac204057..3d7cf8a3421d8 100644 --- a/packages/block-editor/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +++ b/packages/block-editor/src/components/block-list/use-block-props/use-selected-block-event-handlers.js @@ -152,11 +152,14 @@ export function useEventHandlers( { clientId, isSelected } ) { const originX = event.clientX - rect.left; const originY = event.clientY - rect.top; + // Scale everything to 200px. + const dragScale = rect.height > 200 ? 200 / rect.height : 1; + node.style.zIndex = '1000'; node.style.transformOrigin = '0 0'; node.style.transformOrigin = `${ originX }px ${ originY }px`; node.style.transition = 'transform 0.2s ease-out'; - node.style.transform = `scale( 0.5 )`; + node.style.transform = `scale(${ dragScale })`; node.style.margin = '0'; let hasStarted = false;