daybrush / moveable

Moveable! Draggable! Resizable! Scalable! Rotatable! Warpable! Pinchable! Groupable! Snappable!
https://daybrush.com/moveable/
MIT License
10.08k stars 618 forks source link

onScaleGroupEnd e.events only contains bool values #755

Closed Caarnus closed 2 years ago

Caarnus commented 2 years ago

Environments

Description

The events array for the onScaleGroupEnd event only contains bools for the number of objects in the group instead of the individual events. All of the other GroupEnd events seem to contain an array of events.

onScaleGroupEnd={e => {
        ...
}}
e: {
   clientX: 1301
   clientY: 364
   currentTarget: MoveableGroup {props: {…}, context: {…}, refs: {…}, updater: {…}, state: {…}, …}
   datas: {}
   events: (2) [true, true]
   inputEvent: MouseEvent {isTrusted: true, screenX: 1301, screenY: 435, clientX: 1301, clientY: 364, …},
   ...
}
Caarnus commented 2 years ago

I think this change on the Scalable would correct the issue.

    dragControlEnd(moveable: MoveableManagerInterface<ScalableProps>, e: any) {
        const { datas, isDrag } = e;
        if (!datas.isScale) {
            return false;
        }

        datas.isScale = false;
        const params = fillEndParams<OnScaleEnd>(moveable, e, {})
        triggerEvent(moveable, "onScaleEnd", params);
        return params;
    },
daybrush commented 2 years ago

@Caarnus

moveable's new version is released. Check it again.