Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/core/shaders/webgl/Border.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ export const Border: WebGlShaderType<BorderProps> = {
vec2 screenSpace = vec2(2.0 / u_resolution.x, -2.0 / u_resolution.y);
vec2 edge = clamp(a_nodeCoords * 2.0 - vec2(1.0), -1.0, 1.0);

float borderTop = u_borderWidth.x;
float borderRight = u_borderWidth.y;
float borderBottom = u_borderWidth.z;
float borderLeft = u_borderWidth.w;
vec4 adjustedBorderWidth = u_borderWidth - 1.0 + clamp(u_borderWidth, -1.0, 1.0);

float borderTop = adjustedBorderWidth.x;
float borderRight = adjustedBorderWidth.y;
float borderBottom = adjustedBorderWidth.z;
float borderLeft = adjustedBorderWidth.w;

v_outerBorderUv = vec2(0.0);
v_innerBorderUv = vec2(0.0);
Expand Down
10 changes: 6 additions & 4 deletions src/core/shaders/webgl/RoundedWithBorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ export const RoundedWithBorder: WebGlShaderType<RoundedWithBorderProps> = {
v_outerSize = vec2(0.0);

if(borderZero == 0.0) {
float borderTop = u_borderWidth.x;
float borderRight = u_borderWidth.y;
float borderBottom = u_borderWidth.z;
float borderLeft = u_borderWidth.w;
vec4 adjustedBorderWidth = u_borderWidth - 1.0 + clamp(u_borderWidth, -1.0, 1.0);

float borderTop = adjustedBorderWidth.x;
float borderRight = adjustedBorderWidth.y;
float borderBottom = adjustedBorderWidth.z;
float borderLeft = adjustedBorderWidth.w;

v_outerBorderUv = vec2(0.0);
v_innerBorderUv = vec2(0.0);
Expand Down
10 changes: 6 additions & 4 deletions src/core/shaders/webgl/RoundedWithBorderAndShadow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ export const RoundedWithBorderAndShadow: WebGlShaderType<RoundedWithBorderAndSha
v_outerSize = vec2(0.0);

if(borderZero == 0.0) {
float borderTop = u_borderWidth.x;
float borderRight = u_borderWidth.y;
float borderBottom = u_borderWidth.z;
float borderLeft = u_borderWidth.w;
vec4 adjustedBorderWidth = u_borderWidth - 1.0 + clamp(u_borderWidth, -1.0, 1.0);

float borderTop = adjustedBorderWidth.x;
float borderRight = adjustedBorderWidth.y;
float borderBottom = adjustedBorderWidth.z;
float borderLeft = adjustedBorderWidth.w;

v_outerBorderUv = vec2(0.0);
v_innerBorderUv = vec2(0.0);
Expand Down
Loading