aboutsummaryrefslogtreecommitdiffhomepage
path: root/public/bluebey-studio/src/faceArt.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/bluebey-studio/src/faceArt.js')
-rw-r--r--public/bluebey-studio/src/faceArt.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/public/bluebey-studio/src/faceArt.js b/public/bluebey-studio/src/faceArt.js
index 1f7c4ee..01e5c31 100644
--- a/public/bluebey-studio/src/faceArt.js
+++ b/public/bluebey-studio/src/faceArt.js
@@ -1379,6 +1379,9 @@ export function drawEyes(ctx, p) {
};
if (open <= 0.02) {
+ // A shut eye can still be given a white backing (the "白目" switch), which
+ // reads as a line drawn across an eyeball rather than a bare line.
+ if (!line && spec.white === true) fillCircle(ctx, eye.cx, eye.cy, eye.r, white);
drawShutEye(ctx, eye, spec, lineStyle);
// The glasses sit over the shut-eye artwork too, but under the tear below.
drawGlasses(ctx, eye, line, style, limits);
@@ -1402,11 +1405,12 @@ export function drawEyes(ctx, p) {
dy = (dy / dist) * eyeTravel;
}
- // The eyeball's white can be hidden: for a heart it stops the white showing
- // round the lobes, and `hideWhite` does the same for any style (e.g. a line
- // squint) when the user asks for it.
- const hideWhite = style.hideWhite === true || (isHeart && style.heartHideWhite);
- if (!line && !hideWhite) fillCircle(ctx, eye.cx, eye.cy, eye.r, white);
+ // The white of the eye. `spec.white` is per eye and tri-state: `null` keeps
+ // the usual behaviour (an open eye shows its white, a heart does not), while
+ // true/false force it on or off - so an open eye can lose its white, and a
+ // shut eye or a heart can gain it.
+ const showWhite = spec.white == null ? !isHeart : spec.white === true;
+ if (!line && showWhite) fillCircle(ctx, eye.cx, eye.cy, eye.r, white);
const irisX = eye.cx + dx;
const irisY = eye.cy + dy;
if (isHeart) {