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

Normalize Api for getSelectionStyles, setSelectionStyles #4202

Merged
merged 5 commits into from Aug 15, 2017

Conversation

asturur
Copy link
Member

@asturur asturur commented Aug 14, 2017

  • Moved style related method to a different file
  • getSelectionStyles and setSelectionStyles are available for Text now.
  • before it could be called with 0, 1 or 2 arguments. Now or 0 or 2.
  • being a selectionStyle no selection, no style. Calling getSelectionStyles(2,2) will return an empty array.
  • before the function could return a single object or an array of objects. now just array.

charIndex: lines[i - 1].length < selectionStart ? lines[i - 1].length : selectionStart
};
},

Copy link
Member Author

Choose a reason for hiding this comment

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

From here down start the modified methods

this._forceClearCache = true;
return this;
},

Copy link
Member Author

Choose a reason for hiding this comment

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

end of modified methods

@asturur asturur merged commit 3b10702 into master Aug 15, 2017
@asturur asturur deleted the fix-text-getSelectionStyles branch August 17, 2017 13:48
rkrueger11 pushed a commit to FlowMSP/fabric.js that referenced this pull request Sep 6, 2017
* reworked the text selection

* reorganized api

* missing file

* fixed lint

* more test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant