# Fix border rendering · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/3ab20626147a0bbe4739e6bdb8faf8ee78137b22)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 3ab20626147a0bbe4739e6bdb8faf8ee78137b22

Requested commit: 3ab20626147a0bbe4739e6bdb8faf8ee78137b22

Commit: 3ab20626147a0bbe4739e6bdb8faf8ee78137b22

Tree: 9ef5cbda282e2b1a52f9efb4fd4964c320168f4d

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Fix border rendering

After implementing it a while ago, our previous interpolation scheme
didn't really make sense to me and was causing borders to be rendered
incorrectly. We don't really draw backgrounds and borders as part of
the same draw call anymore, but it seemed reasonable to have a correct
implementation in the shader anyway.

This commit uses Porter-Duff compositing (i.e., `over`) to produce
a color that is the result of superimposing the border on top of the
background. Then, we linearly interpolate towards the background color
as we slide out of the border and into the background.

```

## Parents

- [b78497bf5433ecdcb8300c0d432ccc7f9c2a56eb](https://git.cafe/gitcafe/zed/commit/b78497bf5433ecdcb8300c0d432ccc7f9c2a56eb?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/3ab20626147a0bbe4739e6bdb8faf8ee78137b22?format=markdown)
