-
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
Feat/cropzone fix ratio #320
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.
[02/07] 수고 많으십니다.
src/js/component/cropper.js
Outdated
@@ -97,6 +98,7 @@ class Cropper extends Component { | |||
lockScalingFlip: true, | |||
lockRotation: true | |||
}, this.graphics.cropSelectionStyle); | |||
// this._cropzone.lockUniScaling = true; |
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/extension/cropzone.js
Outdated
* @returns {{width: number, height: number}} | ||
* @private | ||
*/ | ||
_cornerTypeValid(selectedCorner) { |
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.
이런 함수는 this를 사용하지 않으니 독립적인 함수로 존재하면 깔끔할 것 같아요. 클래스의 다른 함수들도 그런 모습들이 있네요.
그리고 약간 미세 튜닝 같긴 하지만, 함수 내의 배열은 모듈 로딩할 때 한번만 만드는 것이 어떨까 합니다.
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/extension/cropzone.js
Outdated
* @private | ||
*/ | ||
_resizeTL({x, y}) { | ||
const rect = this.getBoundingRect(false, true); |
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.
이 경우는 destructuring 쓰는게 코드가 좀 더 작지 않을까요?
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.
넵 그럴것 같네요 반영하겠습니다.
* @private | ||
*/ | ||
_calcTopLeftScalingSizeFromPointer(x, y) { | ||
_resizeMT({y}) { |
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.
_resize~~~
메소드에 비슷한 패턴의 코드가 중복인 것 같은데요, 공통 부분을 추출할 수 있을까요?
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.
리뷰 완료입니다!
중복패턴 제거 작업을 #327 에서 마저 작업함 |
* middle commit * feat: cropzone resizer prototype complete * refactor: jsdoc with code style changed * feat: cropzone preset ratio complete * apply codereview
Please check if the PR fulfills these requirements
fix #xxx[,#xxx]
, where "xxx" is the issue number)Description
issue
작업내용
비율 고정시에는 드레그 마우스 포인터와 리사이즈 컨트롤 위치에 따른 리사이즈 비율의 너비 , 높이 기준점을 정하기 위해서 8개 방위의 리사이즈 컨트롤 별로 계산식이 존재 해야되기 때문에, 기존 방식을 버리고 더 접근하기 쉬운 방식으로 8개의 방위별로 각각 dimension을 구하는 방식으로 변경