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

Update imageEditor.js #50

Closed
wants to merge 3 commits into from
Closed
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
changed formatting
  • Loading branch information
OculusMode committed Aug 2, 2018
commit 23f29fa664f7024536f25ef6820380e5405f0f69
12 changes: 7 additions & 5 deletions src/js/imageEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import action from './action';
import commandFactory from './factory/command';
import Graphics from './graphics';
import consts from './consts';
import { sendHostName } from './util';
import {sendHostName} from './util';

const events = consts.eventNames;
const commands = consts.commandNames;
const { keyCodes, rejectMessages } = consts;
const { isUndefined, forEach, CustomEvents } = snippet;
const {keyCodes, rejectMessages} = consts;
const {isUndefined, forEach, CustomEvents} = snippet;

/**
* Image editor
Expand Down Expand Up @@ -198,7 +198,7 @@ class ImageEditor {
* @param {boolean} applyGroupSelectionStyle - whether apply with group selection style or not
* @private
*/
_setSelectionStyle(selectionStyle, { applyCropSelectionStyle, applyGroupSelectionStyle }) {
_setSelectionStyle(selectionStyle, {applyCropSelectionStyle, applyGroupSelectionStyle}) {
if (selectionStyle) {
this._graphics.setSelectionStyle(selectionStyle);
}
Expand Down Expand Up @@ -488,12 +488,14 @@ class ImageEditor {

/**
* set selection style properties
* @param {Object} styles - Object of styles
* @example
* imageEditor.setSelectionStyle({ cornerSize: 50 });
*/
setSelectionStyle(styles) {
this._graphics.setSelectionStyle(styles)
this._graphics.setSelectionStyle(styles);
}

Copy link
Member

Choose a reason for hiding this comment

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

There is an option for setting selectionStyle.

I don't think this method is required.

Copy link
Author

Choose a reason for hiding this comment

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

@junghwan-park indeed there is but only if you include ui. If you don't include UI. then there is no way to change selectionStyles i.e. cornerSize.
Hence one can use this method to do something like:

imageEditor.setSelectionStyle({ cornerSize: 10 });

/**
* discard selction
* @example
Expand Down