-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: free line position middle commit for prototype fix #280
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[12/03] 리뷰 완료합니다.수고하셨습니다.
src/js/graphics.js
Outdated
@@ -996,7 +996,11 @@ class Graphics { | |||
* @private | |||
*/ | |||
_onPathCreated(obj) { | |||
obj.path.set(consts.fObjectOptions.SELECTION_STYLE); | |||
const objCenter = obj.path.getCenterPoint(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
바로 디스트럭쳐링 써도 되겠네요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵 그렇군요. 적용하겠습니다. 감사합니다.
src/js/graphics.js
Outdated
@@ -996,7 +996,11 @@ class Graphics { | |||
* @private | |||
*/ | |||
_onPathCreated(obj) { | |||
obj.path.set(consts.fObjectOptions.SELECTION_STYLE); | |||
const objCenter = obj.path.getCenterPoint(); | |||
obj.path.set(extend({}, consts.fObjectOptions.SELECTION_STYLE, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extend의 첫번째 파라미터에 {left, top}의 객체를 넣으면 파라미터가 한개 줄어드네요.
obj.path.set(extend({
left: objCenter.x,
top: objCenter.y
}, consts.fObjectOptions.SELECTION_STYLE));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네!! 이렇게 하니까 더 간결해졌네요. 감사합니다.
* fix: free line position middle commit for prototype fix * fix: complate free line drawing bug * fix: added test and object extend method change * fix: apply code review
현상
버그 원인
path:created
이벤트가 발생하면 obj를 받아서 origin을 (center, center)로 업데이트 해줌.버그 해결
Free Draw Path의 origin이 (left top -> center center) 로 업데이트 될때, path 객체의 x, y 포지션도 알맞게 업데이트 해줌.
http://10.78.9.21:8000/examples/example01-includeUi.html