Refactor out element context from GPUI
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
black, fill, point, px, size, Bounds, Hsla, LineLayout, Pixels, Point, Result, SharedString,
|
||||
UnderlineStyle, WindowContext, WrapBoundary, WrappedLineLayout,
|
||||
black, fill, point, px, size, Bounds, ElementContext, Hsla, LineLayout, Pixels, Point, Result,
|
||||
SharedString, UnderlineStyle, WrapBoundary, WrappedLineLayout,
|
||||
};
|
||||
use derive_more::{Deref, DerefMut};
|
||||
use smallvec::SmallVec;
|
||||
@@ -33,7 +33,7 @@ impl ShapedLine {
|
||||
&self,
|
||||
origin: Point<Pixels>,
|
||||
line_height: Pixels,
|
||||
cx: &mut WindowContext,
|
||||
cx: &mut ElementContext,
|
||||
) -> Result<()> {
|
||||
paint_line(
|
||||
origin,
|
||||
@@ -66,7 +66,7 @@ impl WrappedLine {
|
||||
&self,
|
||||
origin: Point<Pixels>,
|
||||
line_height: Pixels,
|
||||
cx: &mut WindowContext,
|
||||
cx: &mut ElementContext,
|
||||
) -> Result<()> {
|
||||
paint_line(
|
||||
origin,
|
||||
@@ -87,7 +87,7 @@ fn paint_line(
|
||||
line_height: Pixels,
|
||||
decoration_runs: &[DecorationRun],
|
||||
wrap_boundaries: &[WrapBoundary],
|
||||
cx: &mut WindowContext<'_>,
|
||||
cx: &mut ElementContext<'_>,
|
||||
) -> Result<()> {
|
||||
let padding_top = (line_height - layout.ascent - layout.descent) / 2.;
|
||||
let baseline_offset = point(px(0.), padding_top + layout.ascent);
|
||||
|
||||
Reference in New Issue
Block a user