Skip to content

Commit

Permalink
Fix glitch where blending was to to wrong a, r, g
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Jan 13, 2023
1 parent 50d1eb5 commit 0cf5fc6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/painter/gl/shaders.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion internal/painter/gl/shaders/round_rectangle.frag
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ void main() {
float distance = calc_distance(vec_centered_pos, vec2(rect_size_half.x, rect_size_half.y), radius - stroke_width_half);

vec4 from_color = stroke_color; //Always the border color. If no border, this still should be set
vec4 to_color = vec4(1.0, 1.0, 1.0, 0.0); //Outside color
vec4 to_color = stroke_color; //Outside color
to_color[3] = 0.0; // blend the stroke colour to alpha

if (stroke_width_half == 0.0)
{
from_color = fill_color;
to_color = fill_color;
to_color[3] = 0.0; // blend the fill colour to alpha
}

if (distance < 0.0)
Expand Down

0 comments on commit 0cf5fc6

Please sign in to comment.