-
Notifications
You must be signed in to change notification settings - Fork 236
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
Enhancement: provide IndexRange for Paragraph #42
Comments
You can already do that using these methods int par = area.getCurrentParagraph();
int parLen = area.getParagraphs().get(par).length();
StyleSpans<S> styles = area.getStyleSpans(par, 0, parLen);
StyleSpans<S> newStyles = styles.mapStyles(...);
area.setStyleSpans(par, 0, newStyles); |
Nice! Thanks. That did it :D On Wed, Apr 16, 2014 at 3:35 PM, TomasMikula [email protected]:
|
I added a convenience method, so the above code can now be rewritten as int par = area.getCurrentParagraph();
StyleSpans<S> styles = area.getStyleSpans(par);
StyleSpans<S> newStyles = styles.mapStyles(...);
area.setStyleSpans(par, 0, newStyles); |
Thanks! I just downloaded it. It works fine. On Wed, Apr 16, 2014 at 4:31 PM, TomasMikula [email protected]:
|
Would it be possible to provide indexRange for a given paragraph. This is the use case:
I have a paragraph with multiple styled text objects, each has its own. I need to change one style parameter, for example size.
I am using the styles.mapStyles method. then I apply styles to the whole text area at a given range.
I need a way to know where the given paragraph starts or end in reference to the text area. I tried to figure it out but I could not reach a solution.
The text was updated successfully, but these errors were encountered: