moveable icon indicating copy to clipboard operation
moveable copied to clipboard

Snap settings with `keepRatio` set to `false` are not honored

Open davidalejandroaguilar opened this issue 2 years ago • 4 comments

Environments

Framework name: StimulusJS Framework version: 3.2.1 Moveable Component version: 0.51.1 Selecto Component version: 1.26.0 Testable Address(optional): https://codepen.io/davidalejandroaguilar/pen/VwVNxWz

Description

When resizing selected elements with snap settings (snapGridWidth, snapGridHeight, snapThreshold, snapRotationThreshold, snapRotationDegrees) and keepRatio set to false, the elements no longer respect snap settings (50px snapping in the example Codepen).

In the video below, you can see how each individual element can only be resized in 50px increments, however, when both are resized at the same time, they are no longer snapping correctly, and they end up outside the grid.

https://github.com/daybrush/moveable/assets/15317732/4299c49a-e0b6-4ffc-8798-6a0225f6ca74

davidalejandroaguilar avatar Aug 08 '23 02:08 davidalejandroaguilar

@daybrush Just bringing this into your attention, seems like it's a bug?

EDIT: Oops, sorry, just noticed you were on vacation, my bad and hope you enjoyed them! 🏖️

davidalejandroaguilar avatar Sep 22 '23 01:09 davidalejandroaguilar

@davidalejandroaguilar

sorry. I couldn't care much.

your expected behavior

If keepRatio (false) and snapGridWidth and snapGridHeight are set, you want snapGrid to work individually, not on a group basis, right?

daybrush avatar Sep 30 '23 08:09 daybrush

@daybrush I think so, yes.

Each individual element must stay within the grid, even when resizing as a group.

davidalejandroaguilar avatar Sep 30 '23 17:09 davidalejandroaguilar

@davidalejandroaguilar

  • croact-moveable 0.8.0
  • @moveable/helper 0.1.3
  • lit-moveable 0.29.0
  • moveable 0.52.0
  • preact-moveable 0.54.0
  • react-moveable 0.55.0
  • svelte-moveable 0.44.0
  • vue-moveable 2.0.0-beta.86
  • vue3-moveable 0.27.0
  • ngx-moveable 0.49.0

moveable's new version is released. snapGridAll prop is added. Use snapGridAll prop to true.

daybrush avatar Oct 28 '23 06:10 daybrush