swayfx icon indicating copy to clipboard operation
swayfx copied to clipboard

Improve rounded border corners

Open WillPower3309 opened this issue 3 years ago • 4 comments

  • Description: There are some improvements that could be made in how we handle rendering rounded corners. Currently, rounded borders are done by drawing circles and removing the parts that are not along the corner we are currently rendering, and rounded titlebars will be blended with a window's rounded corners through its fragment shader, which is less than ideal for keeping things simple. I'll be working on making these things cleaner (and hopefully more performant), once we get an initial release out.

WillPower3309 avatar Oct 18 '22 16:10 WillPower3309

still need to do this, but for now I've cleaned up the existing border shader from 54 to 36 lines

WillPower3309 avatar Oct 26 '22 05:10 WillPower3309

Related:

  • https://github.com/ocornut/imgui/issues/1962
  • https://github.com/Javyre/swayfire/blob/master/src/deco/subsurf.cpp#L19-L52
  • https://stackoverflow.com/questions/20508259/draw-a-curved-line-from-an-arc-edge

WillPower3309 avatar Nov 01 '22 22:11 WillPower3309

Oh! That looks promising!

ErikReider avatar Nov 01 '22 22:11 ErikReider

If we go the stencil route, this would likely fix #113 and #47 (and integrate well with #127)

WillPower3309 avatar Mar 17 '23 17:03 WillPower3309