Skip to content

Sample project showing a jumpy position update of a group of dragged objects using Redux, React, and Konva.

Notifications You must be signed in to change notification settings

bmoquist/konva-position-update-issue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Created this simple example of an issue that I'm encountering in a larger application. Not sure sure if the issue is related to the absolutePosition method in Konva or a logic error on my part -- looking for suggestions how to achieve the objective. This project was bootstrapped with Create React App.

Konva issue

  • Objective: Move a group of objects together by dispatching Redux actions and using position information from the Redux store for rendering
  • Current Approach:
    • Get the absolute position of one of the objects at drag start and the new absolute position of the same object at drag end
    • Calculate the position change (delta)
    • Dispatch the calculated delta to Redux and adjust all of the positions of the objects by the delta in the reducer
  • Issue:
    • The objects on canvas jump and do not match the amount dragged after the Redux update.
    • For debugging, the object positions are printed to the Console and Redux Dev tools can be used to examine state.

To Run

  • Run yarn install in the repository local folder and then run yarn start -- should launch to localhost:3000
  • Debugging information in the console and Redux Dev Tools

About

Sample project showing a jumpy position update of a group of dragged objects using Redux, React, and Konva.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published