@@ 59,6 59,9 @@ borderFragmentShader = B8.pack $ unlines [
" float width = widths[side];",
" vec2 dotCenter = vec2(segment*width*2 + width, width/2);",
" int stroke3 = int(floor(3*pos.y/widths[side]));",
+ " int stroke = int(floor(2*pos.y/widths[side]));",
+ " bool topleft = side == TOP || side == LEFT;",
+ " if (!topleft) stroke = abs(1 - stroke);",
" if (styles[side] == SOLID) fcolour = colours[side];",
" else if (styles[side] == DASHED)",
" fcolour = segment % 2 == 0 ? colours[side] : vec4(0);",
@@ 66,6 69,14 @@ borderFragmentShader = B8.pack $ unlines [
" fcolour = distance(pos, dotCenter) < widths[side]/2 ?",
" colours[side] : vec4(0);",
" else if (styles[side] == DOUBLE && stroke3 != 1) fcolour = colours[side];",
+ " else if (styles[side] == GROOVE)",
+ " fcolour = colours[side] + vec4(stroke == 0 ? -0.1 : +0.1);",
+ " else if (styles[side] == RIDGE)",
+ " fcolour = colours[side] + vec4(stroke == 0 ? +0.1 : -0.1);",
+ " else if (styles[side] == INSET)",
+ " fcolour = colours[side] + vec4(topleft ? -0.2 : +0.2);",
+ " else if (styles[side] == OUTSET)",
+ " fcolour = colours[side] + vec4(topleft ? +0.2 : -0.2);",
" else fcolour = vec4(0.0);",
"}"
]
@@ 72,7 72,7 @@ instance PropertyParser Border where
longhand _ self@Border { borderPallet = cc } "border-bottom-color" ts
| Just ([], v) <- parseColour cc ts = Just self { bottomColour' = Just v }
longhand _ self@Border { borderPallet = cc } "border-left-color" ts
- | Just ([], v) <- parseColour cc ts = Just self { bottomColour' = Just v }
+ | Just ([], v) <- parseColour cc ts = Just self { leftColour' = Just v }
-- Should be handled by caller, but for the sake of shorthands...
longhand _ self "border-top-width" [Dimension _ _ "px"] = Just self