mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
Render borders correctly when only a subset of the border is visible
This commit is contained in:
parent
073ff96a9f
commit
d853dbb048
2 changed files with 11 additions and 5 deletions
|
@ -81,11 +81,17 @@ fragment float4 quad_fragment(
|
|||
float2 rounded_edge_to_point = abs(center_to_point) - half_size + input.corner_radius;
|
||||
float distance = length(max(0., rounded_edge_to_point)) + min(0., max(rounded_edge_to_point.x, rounded_edge_to_point.y)) - input.corner_radius;
|
||||
|
||||
float border_width = 0.;
|
||||
if (edge_to_point.x > edge_to_point.y) {
|
||||
border_width = center_to_point.x <= 0. ? input.border_left : input.border_right;
|
||||
float vertical_border = center_to_point.x <= 0. ? input.border_left : input.border_right;
|
||||
float horizontal_border = center_to_point.y <= 0. ? input.border_top : input.border_bottom;
|
||||
float2 inset_size = half_size - input.corner_radius - float2(vertical_border, horizontal_border);
|
||||
float2 point_to_inset_corner = abs(center_to_point) - inset_size;
|
||||
float border_width;
|
||||
if (point_to_inset_corner.x < 0. && point_to_inset_corner.y < 0.) {
|
||||
border_width = 0.;
|
||||
} else if (point_to_inset_corner.y > point_to_inset_corner.x) {
|
||||
border_width = horizontal_border;
|
||||
} else {
|
||||
border_width = center_to_point.y <= 0. ? input.border_top : input.border_bottom;
|
||||
border_width = vertical_border;
|
||||
}
|
||||
|
||||
float4 color;
|
||||
|
|
|
@ -173,7 +173,7 @@ impl Pane {
|
|||
ctx.emit(Event::Split(direction));
|
||||
}
|
||||
|
||||
fn render_tabs<'a>(&self, app: &AppContext) -> ElementBox {
|
||||
fn render_tabs(&self, app: &AppContext) -> ElementBox {
|
||||
let settings = smol::block_on(self.settings.read());
|
||||
let border_color = ColorU::from_u32(0xdbdbdcff);
|
||||
|
||||
|
|
Loading…
Reference in a new issue