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

feat: Update fabric.js version to v2.7.0 #201

Merged
merged 31 commits into from
May 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ef26bd5
interim
junghwan-park Feb 14, 2019
9efbdc1
interim
junghwan-park Mar 8, 2019
38d470c
interim: named import
junghwan-park Mar 15, 2019
1cd15ab
fix: Deleting i-text by backspace or delete key pressed when text edi…
junghwan-park Mar 19, 2019
d254176
fix: Resolve rotation breaking change
junghwan-park Mar 19, 2019
91ac120
interim: Normalize filters except RemoveWhite, ColorFilter, GradientT…
junghwan-park Mar 19, 2019
a49223b
interim: cropzone
junghwan-park Mar 19, 2019
4bc5253
fix: Set color method of Icon
junghwan-park Apr 16, 2019
a0a5972
fix: Mask filter
junghwan-park Apr 18, 2019
efc6fd6
fix: Change group type verification to 'activeSelection'
junghwan-park Apr 18, 2019
9a1320d
fix: Cropzone rendering
junghwan-park Apr 23, 2019
39f7c00
fix: Disable objectCaching
junghwan-park Apr 24, 2019
27322f9
fix: Resolve rotation range bar malfunction
junghwan-park Apr 24, 2019
9e3291e
fix: Resolve cropzone scaling issue
junghwan-park Apr 24, 2019
e49004c
fix: Modify getCropzoneRect() cropzone api
junghwan-park Apr 24, 2019
e9e0389
fix: Resolve T/C Errors
junghwan-park May 2, 2019
74b920b
fix: fabric.js external aid
junghwan-park May 2, 2019
26ecd38
interim: Remaining range bar rotation undo/redo feature
junghwan-park May 2, 2019
65b2dc5
feat: Synchronize range bar and value with current image rotation info
junghwan-park May 2, 2019
a8299fd
fix: fabric.js external aid
junghwan-park May 2, 2019
0f7dcb5
fix: Return _rotate() promise
junghwan-park May 2, 2019
c4b2d2d
fix: Check text double clicked for edit text
junghwan-park May 2, 2019
ab0abf7
fix: Resolve Basic example's bugs
junghwan-park May 2, 2019
3c2e58c
fix: Resolve T/C error
junghwan-park May 2, 2019
9a71acf
chore: Modify JSDoc
junghwan-park May 2, 2019
6e61cb7
fix: Return what it got
junghwan-park May 2, 2019
91a4361
chore: Update JSDoc
junghwan-park May 2, 2019
211edc0
chore: Revert codes
junghwan-park May 3, 2019
3da8d1e
fix: Remove Gradient Transparency
junghwan-park May 3, 2019
ce3d68d
chore: Change karma environment
junghwan-park May 3, 2019
633fe18
fix: Rotate button error
junghwan-park May 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Synchronize range bar and value with current image rotation info
  • Loading branch information
junghwan-park committed May 2, 2019
commit 65b2dc5c3c88998b179fa8e138939817ec8fb406
14 changes: 12 additions & 2 deletions src/js/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ export default {
this.ui.changeMenu('crop');
}
};
const setAngleRangeBarOnAction = angle => {
if (this.ui.submenu === 'rotate') {
this.ui.rotate.setRangeBarAngle('setAngle', angle);
}
};
const onEndUndoRedo = result => {
setAngleRangeBarOnAction(result);
};

return extend({
initLoadImage: (imagePath, imageName) => (
Expand All @@ -49,13 +57,13 @@ export default {
undo: () => {
if (!this.isEmptyUndoStack()) {
exitCropOnAction();
this.undo();
this.undo().then(onEndUndoRedo);
}
},
redo: () => {
if (!this.isEmptyRedoStack()) {
exitCropOnAction();
this.redo();
this.redo().then(onEndUndoRedo);
}
},
reset: () => {
Expand Down Expand Up @@ -272,10 +280,12 @@ export default {
rotate: (angle, isSilent) => {
this.rotate(angle, isSilent);
this.ui.resizeEditor();
this.ui.rotate.setRangeBarAngle('rotate', angle);
},
setAngle: (angle, isSilent) => {
this.setAngle(angle, isSilent);
this.ui.resizeEditor();
this.ui.rotate.setRangeBarAngle('setAngle', angle);
}
}, this._commonAction());
},
Expand Down
17 changes: 16 additions & 1 deletion src/js/ui/rotate.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,21 @@ class Rotate extends Submenu {
};
}

setRangeBarAngle(type, angle) {
let resultAngle = angle;

if (type === 'rotate') {
resultAngle = parseInt(this._els.rotateRangeValue.value, 10) + angle;
}

this._els.rotateRangeValue.value = resultAngle;
this._setRangeBarRatio(resultAngle);
}

_setRangeBarRatio(angle) {
this._els.rotateRange.value = angle;
}

/**
* Add event for rotate
* @param {Object} actions - actions for crop
Expand All @@ -53,7 +68,7 @@ class Rotate extends Submenu {
_changeRotateForRange(value, isLast) {
const angle = toInteger(value);
this._els.rotateRangeValue.value = angle;
this.actions.rotate(angle - this._value, !isLast);
this.actions.setAngle(angle, !isLast);
this._value = angle;
}

Expand Down