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

Support for setting stroke colour and width of background shapes in TextExt #497

Closed
wants to merge 1 commit into from

Conversation

neilccbrown
Copy link

I wonder if you're interested in adding this feature. It allows you to use stroke as a highlight for some text, instead of or in addition to background colour. The main limitation is noted in the docs: adjacent segments with different styles will get their strokes painted separately. That will make it less useful for some use cases, but if you just have a fairly plain text editor and want to add support for highlighting e.g. find results by drawing around them instead of using a background colour, it's useful.

…idth for background shapes in TextExt.

Allows you to use stroke as a highlight for some text, instead of or in addition to background colour.  The main limitation is noted in the docs: adjacent segments with different styles will get their strokes painted separately.
@JordanMartinez
Copy link
Contributor

What problem is this PR trying to solve? "support for highlighting" ?

@neilccbrown
Copy link
Author

The problem was "the editor doesn't support drawing a border around particular text segments". I was porting an interface which used background colour and a stroked border around the region to highlight search results in the editor. TextExt lacked support for the stroke aspect and I couldn't see a work-around from outside the library, so I added it. I know it's not a desperately lacking feature but I thought I would offer the code, to see if you felt enough other people would have similar use cases.

@JordanMartinez
Copy link
Contributor

I think the feature is worth adding, but the main limitation "adjacent segments with different styles will get their strokes painted separately" presents an issue. I think this should be further discussed in #346 before attempting a PR. Additionally, #484 might play a role in it, too.

@neilccbrown
Copy link
Author

Ah, sorry -- didn't spot there was already a request for it. Not sure which thread to point this out, but there is already an issue with adjacent segments with different styles and solid backgrounds: a faint sliver of the main editor background colour is visible between adjacent segments with different styles but the same background colour (example below). So I figured it wasn't adding a new restriction, it's just more prominent when you're drawing a stroke.

image

@JordanMartinez
Copy link
Contributor

Ah, sorry -- didn't spot there was already a request for it.

No worries! It happens.

There is already an issue with adjacent segments with different styles and solid backgrounds: a faint sliver of the main editor background colour is visible between adjacent segments with different styles but the same background colour (example below)

Yeah. I think I noted the same thing when the feature was first introduced. However, because it was not super noticeable, nothing else was done.

Let's move further discussion to the issue, not this PR.

@JordanMartinez
Copy link
Contributor

@twistedsquare Would you like to re-implement this again after I merge #558? The "adjacent segments" issue raised earlier is addressed in that PR.

@JordanMartinez
Copy link
Contributor

Closing since #560 added this support.

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.

2 participants