Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrected event noti at cropzone (fixed #269) #308

Merged
merged 6 commits into from
Jan 28, 2020

Conversation

jinwoo-kim-nhn
Copy link
Contributor

@jinwoo-kim-nhn jinwoo-kim-nhn commented Jan 23, 2020

Please check if the PR fulfills these requirements

  • It's submitted to right branch according to our branching model
  • It's right issue type on title
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • It does not introduce a breaking change or has description for the breaking change

Description

issue

원인

  • canvs.on('objectScale') 또는 canvs.on('objectMoved') 이벤트가 일어난 후에 cropzone 객체가 객체의 포지션을 규칙에 맞게(cropzone 영역이 캔버스 영역 밖으로 못 벗어나게) 바꾸어 버림, 사용자는 바뀌기 전의 포지션 정보를 받으므로 오류로 인식하게 됨.

해결

  • objectMoved 또는 objectScale의 첫 이벤트가 일어날때 target객체(cropzone)가 캔버스이벤트위임 기능을 가지고 있으면, 이후의 이벤트는 전부 target객체(cropzone)에게 알아서 이벤트 시점에 맞게 이벤트를 발생시키도록 역할 위임

@jinwoo-kim-nhn jinwoo-kim-nhn changed the title Fix/incorrected event noti at cropzone fix: incorrected event noti at cropzone (#269) Jan 23, 2020
@jinwoo-kim-nhn jinwoo-kim-nhn changed the title fix: incorrected event noti at cropzone (#269) fix: incorrected event noti at cropzone (fixed #269) Jan 23, 2020

this.fire(events.OBJECT_SCALED, params);
if (['none', 'registed'].indexOf(eventDelegationRegister) < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eventDelegation함수의 리턴값 타입이 여러 개라서 코드 읽기가 조금 시간이 더 걸리네요. register 기능은 따로 빼는 건 어떠세요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 따로 빼는게 좋겠네요. 리뷰 감사합니다.

@dongsik-yoo
Copy link
Contributor

[01/28] 수고 많으셨습니다.

@jinwoo-kim-nhn jinwoo-kim-nhn merged commit c4a2e1d into master Jan 28, 2020
@jinwoo-kim-nhn jinwoo-kim-nhn deleted the fix/incorrectedEventNotiAtCropzone branch March 20, 2020 08:13
HerlinMatos pushed a commit to EveryMundo/tui.image-editor that referenced this pull request Jul 2, 2020
* fix: incorrected event noti at cropzone

* middle commit

* refactor: changed to forward event delegation commands only once.

* refactor: remove incorrected prams and remove console log

* refactor: removed unnessary module at test code

* apply codereview
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants