@@ -52,8 +52,8 @@ void EllipseEye::draw(M5Canvas *canvas, BoundingRect rect, DrawContext *ctx) {
5252 this ->width_ / 2 - thickness,
5353 this ->height_ / 4 + thickness, background_color_);
5454 canvas->fillRect (shifted_x_ - this ->width_ / 2 ,
55- wink_base_y + thickness / 2 , this ->width_ ,
56- this ->height_ / 4 , background_color_);
55+ wink_base_y + thickness / 2 , this ->width_ + 1 ,
56+ this ->height_ / 4 + 1 , background_color_);
5757 return ;
5858 }
5959
@@ -104,13 +104,14 @@ void GirlyEye::drawEyeLid(M5Canvas *canvas) {
104104 auto upper_eyelid_y = shifted_y_ - 0 .8f * height_ / 2 +
105105 (1 .0f - open_ratio_) * this ->height_ * 0.6 ;
106106
107- float el_x0, el_y0, el_x1, el_y1, el_x2, el_y2;
108- el_x0 = this ->is_left_ ? shifted_x_ + 22 : shifted_x_ - 22 ;
109- el_y0 = upper_eyelid_y - 27 ;
110- el_x1 = this ->is_left_ ? shifted_x_ + 26 : shifted_x_ - 26 ;
111- el_y1 = upper_eyelid_y;
112- el_x2 = this ->is_left_ ? shifted_x_ - 10 : shifted_x_ + 10 ;
113- el_y2 = upper_eyelid_y;
107+ float eyelash_x0, eyelash_y0, eyelash_x1, eyelash_y1, eyelash_x2,
108+ eyelash_y2;
109+ eyelash_x0 = this ->is_left_ ? shifted_x_ + 22 : shifted_x_ - 22 ;
110+ eyelash_y0 = upper_eyelid_y - 27 ;
111+ eyelash_x1 = this ->is_left_ ? shifted_x_ + 26 : shifted_x_ - 26 ;
112+ eyelash_y1 = upper_eyelid_y;
113+ eyelash_x2 = this ->is_left_ ? shifted_x_ - 10 : shifted_x_ + 10 ;
114+ eyelash_y2 = upper_eyelid_y;
114115
115116 float tilt = 0 .0f ;
116117 float ref_tilt = open_ratio_ * M_PI / 6 .0f ;
@@ -145,17 +146,17 @@ void GirlyEye::drawEyeLid(M5Canvas *canvas) {
145146 eyelid_bottom_right_x, eyelid_bottom_right_y,
146147 tilt, shifted_x_, upper_eyelid_y, primary_color_);
147148
148- el_x0 += bias;
149- el_x1 += bias;
150- el_x2 += bias;
149+ eyelash_x0 += bias;
150+ eyelash_x1 += bias;
151+ eyelash_x2 += bias;
151152 }
152153
153154 // eyelash
154- rotatePointAround (el_x0, el_y0 , tilt, shifted_x_, upper_eyelid_y);
155- rotatePointAround (el_x1, el_y1 , tilt, shifted_x_, upper_eyelid_y);
156- rotatePointAround (el_x2, el_y2 , tilt, shifted_x_, upper_eyelid_y);
157- canvas->fillTriangle (el_x0, el_y0, el_x1, el_y1, el_x2, el_y2 ,
158- primary_color_);
155+ rotatePointAround (eyelash_x0, eyelash_y0 , tilt, shifted_x_, upper_eyelid_y);
156+ rotatePointAround (eyelash_x1, eyelash_y1 , tilt, shifted_x_, upper_eyelid_y);
157+ rotatePointAround (eyelash_x2, eyelash_y2 , tilt, shifted_x_, upper_eyelid_y);
158+ canvas->fillTriangle (eyelash_x0, eyelash_y0, eyelash_x1, eyelash_y1 ,
159+ eyelash_x2, eyelash_y2, primary_color_);
159160}
160161
161162void GirlyEye::overwriteOpenRatio () {
@@ -219,13 +220,14 @@ void PinkDemonEye::drawEyeLid(M5Canvas *canvas) {
219220 auto upper_eyelid_y = shifted_y_ - 0 .8f * height_ / 2 +
220221 (1 .0f - open_ratio_) * this ->height_ * 0.6 ;
221222
222- float el_x0, el_y0, el_x1, el_y1, el_x2, el_y2;
223- el_x0 = this ->is_left_ ? shifted_x_ + 22 : shifted_x_ - 22 ;
224- el_y0 = upper_eyelid_y - 27 ;
225- el_x1 = this ->is_left_ ? shifted_x_ + 26 : shifted_x_ - 26 ;
226- el_y1 = upper_eyelid_y;
227- el_x2 = this ->is_left_ ? shifted_x_ - 10 : shifted_x_ + 10 ;
228- el_y2 = upper_eyelid_y;
223+ float eyelash_x0, eyelash_y0, eyelash_x1, eyelash_y1, eyelash_x2,
224+ eyelash_y2;
225+ eyelash_x0 = this ->is_left_ ? shifted_x_ + 22 : shifted_x_ - 22 ;
226+ eyelash_y0 = upper_eyelid_y - 27 ;
227+ eyelash_x1 = this ->is_left_ ? shifted_x_ + 26 : shifted_x_ - 26 ;
228+ eyelash_y1 = upper_eyelid_y;
229+ eyelash_x2 = this ->is_left_ ? shifted_x_ - 10 : shifted_x_ + 10 ;
230+ eyelash_y2 = upper_eyelid_y;
229231
230232 float tilt = 0 .0f ;
231233 float ref_tilt = open_ratio_ * M_PI / 6 .0f ;
@@ -260,15 +262,15 @@ void PinkDemonEye::drawEyeLid(M5Canvas *canvas) {
260262 eyelid_bottom_right_x, eyelid_bottom_right_y,
261263 tilt, shifted_x_, upper_eyelid_y, primary_color_);
262264
263- el_x0 += bias;
264- el_x1 += bias;
265- el_x2 += bias;
265+ eyelash_x0 += bias;
266+ eyelash_x1 += bias;
267+ eyelash_x2 += bias;
266268 }
267269
268270 // eyelash
269- rotatePointAround (el_x0, el_y0 , tilt, shifted_x_, upper_eyelid_y);
270- rotatePointAround (el_x1, el_y1 , tilt, shifted_x_, upper_eyelid_y);
271- rotatePointAround (el_x2, el_y2 , tilt, shifted_x_, upper_eyelid_y);
271+ rotatePointAround (eyelash_x0, eyelash_y0 , tilt, shifted_x_, upper_eyelid_y);
272+ rotatePointAround (eyelash_x1, eyelash_y1 , tilt, shifted_x_, upper_eyelid_y);
273+ rotatePointAround (eyelash_x2, eyelash_y2 , tilt, shifted_x_, upper_eyelid_y);
272274}
273275
274276void PinkDemonEye::overwriteOpenRatio () {
0 commit comments