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 version to 4.2.0 [#461] #491

Merged
merged 9 commits into from
Dec 8, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
fix: icon event drag error bug at IE
  • Loading branch information
jinwoo-kim-nhn committed Nov 27, 2020
commit 059328e0cf25884736cdf8fa6d9b202682102074
3 changes: 0 additions & 3 deletions examples/example01-includeUi.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
window.onresize = function() {
imageEditor.ui.resizeEditor();
}
imageEditor.on('objectActivated', jjjj => {
console.log('jjj', jjjj);
});
</script>
</body>
</html>
36 changes: 20 additions & 16 deletions src/js/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,6 @@ export default {
let iconHeight;
let objId;

this.on({
'iconCreateResize': ({moveOriginPointer}) => {
const scaleX = (moveOriginPointer.x - startX) / iconWidth;
const scaleY = (moveOriginPointer.y - startY) / iconHeight;

this.setObjectPropertiesQuietly(objId, {
scaleX: Math.abs(scaleX * 2),
scaleY: Math.abs(scaleY * 2)
});
},
'iconCreateEnd': () => {
this.ui.icon.clearIconType();
this.changeSelectableAll(true);
}
});

const mouseDown = (e, originPointer) => {
startX = originPointer.x;
startY = originPointer.y;
Expand All @@ -173,6 +157,26 @@ export default {
objId = obj.id;
iconWidth = obj.width;
iconHeight = obj.height;

this.on({
'iconCreateResize': ({moveOriginPointer}) => {
const scaleX = (moveOriginPointer.x - startX) / iconWidth;
const scaleY = (moveOriginPointer.y - startY) / iconHeight;

this.setObjectPropertiesQuietly(objId, {
scaleX: Math.abs(scaleX * 2),
scaleY: Math.abs(scaleY * 2)
});
},
'iconCreateEnd': () => {
this.ui.icon.clearIconType();
this.changeSelectableAll(true);

objId = null;
this.off('iconCreateResize');
this.off('iconCreateEnd');
}
});
});
};

Expand Down