Skip to content

Moveable controls not really following mouse cursor when scaling #591

Description

@dizayn-design

Environments

  • Framework name: React
  • Framework version: 17.0.2
  • Moveable Component version: 0.30.3
  • Testable Address(optional):

Description

When I snatch the control to scale the object, the control doesn't follow the cursor properly.
I would expect that the scaling happens that way that the corner of the object (the control) always being at the cursor's position.

moevableScalıng

...
<Moveable
          target={ref.current}
          scalable={true}
          draggable={true}
          onScale={e => (ref.current!).style.transform = e.transform}
          onDrag={e => (ref.current!).style.transform = e.transform}
          renderDirections={['sw', 'nw', 'se', 'ne']}
        />
  <div ref={ref} style={{width: '100px', height: '100px', background: 'red', transform: 'translate(200px, 200px)'}}>
    foo
  </div>
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcomplete

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions