Commit Graph
26 Commits
Author SHA1 Message Date
Antonio Scandurra 5b71901912 Flush pending underline when we are at the end of the line 2021-09-07 11:04:44 +02:00
Antonio Scandurra cf68ad3a82 Trim pending underline when text runs don't cover the whole line 2021-09-07 11:03:43 +02:00
Nathan Sobo 6323e8cc59 WIP: Try rendering underlines after all other quads
I thought this would allow underlines to show up in tabs, but it doesn't seem to be working.
2021-09-06 16:57:58 -06:00
Max BrunsfeldandNathan Sobo 9346aa300d Start work on underlined text
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-09-06 15:36:09 -07:00
Antonio ScandurraandNathan Sobo 2d5abee655 Fix calculation of visible glyph bounds
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-09-02 16:24:52 +02:00
Antonio ScandurraandNathan Sobo 6a071e865f Make Line::paint interface consistent with Line::paint_wrapped
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-09-02 14:33:52 +02:00
Antonio ScandurraandNathan Sobo bdc35f03f2 Paint only glyphs that intersect the visible bounds in Text
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-09-02 14:14:05 +02:00
Antonio ScandurraandNathan Sobo 1aa1e6c6ab Move pooling of line wrappers into FontCache
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-25 17:28:25 +02:00
Antonio Scandurra 72f282eb3a Calculate current line width correctly when wrapping shaped lines 2021-08-25 15:21:04 +02:00
Antonio Scandurra 399ecaabc6 Wrap lines in Text element 2021-08-25 14:59:52 +02:00
Antonio Scandurra 463284f0af Move LineWrapper into gpui 2021-08-25 10:43:54 +02:00
Max BrunsfeldandNathan Sobo 91c2b5825e Add LineWrapper::wrap_shaped_line
This allows us to perform wrapping based on
glyph positions in an already-shaped line. We
plan to use this in the new Text element,
because there we'll already need to do text
shaping as part of layout. This text isn't editable
so it won't need to be rewrapped with the same
frequency as the text editor's content.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-24 18:09:36 -07:00
Max BrunsfeldandNathan Sobo ef0ffbe819 Use custom color wrapper type everywhere in gpui & zed
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-08-03 12:48:58 -07:00
Antonio Scandurra 9895c77f5c WIP 2021-07-16 18:43:50 +02:00
Max Brunsfeld 6ef447866a Rename context parameters to cx in gpui 2021-05-28 15:32:35 -07:00
Nathan Sobo b075b0108d Clarify variable name 2021-05-21 14:14:05 -06:00
Nathan Sobo 92ff7f4e5e Accept colors in styling runs passed to layout_str
Also move from the runs being expressed as ranges to the runs being expressed as a sequence of contiguous scalar lengths.
2021-05-21 14:10:38 -06:00
Nathan Sobo 2a9e71d725 Vertically center glyphs in Line::paint based on ascender/descender for line 2021-04-06 09:15:21 -06:00
Antonio Scandurra e487aa5cbd Don't render glyphs located outside of BufferElement's bounds 2021-04-01 11:19:50 +02:00
Antonio Scandurra 466f6e0479 Center line around its bounding box 2021-03-25 17:21:26 +01:00
Antonio Scandurra 0906b2a2f4 Remove unused dependencies and avoid instantiating FontCache in tests 2021-03-25 10:48:32 +01:00
Antonio ScandurraandNathan Sobo 9178e91cc0 Extract platform-dependant FontSystem
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-03-24 16:51:28 +01:00
Antonio ScandurraandNathan Sobo ad7974608b WIP
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-03-23 19:11:56 +01:00
Antonio ScandurraandNathan Sobo 764bfba2e2 WIP: Start on rendering glyphs
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2021-03-23 15:15:41 +01:00
Nathan Sobo 119aa452b6 Overhaul the entire element system
Now the Element trait is designed to be wrapped in a Lifecycle enum that gets placed inside an ElementBox. This allows the framework to store data on behalf of the Element implementation, such as sizes, bounds, and also implementation-specific LayoutState and PaintState types. This makes it easier to reason about which data is available in each Element method.
2021-03-21 20:54:23 -06:00
Nathan Sobo 23308e17a9 WIP on rebuilding with extracted UI framework 2021-03-18 13:13:31 -06:00