Guest User

Untitled

a guest
Feb 18th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. drawWheelText(idx, text, bingo) {
  2. const {
  3. isMobile,
  4. } = this.state;
  5.  
  6. this.ctx.beginPath();
  7. this.ctx.save();
  8. this.ctx.font = `${isMobile ? '12px' : '16px'} 微软雅黑`;
  9. this.ctx.fillStyle = (bingo && bingo === text && 'green') || 'red';
  10. this.ctx.rotate(((idx * this.singlePizzaAngle) + (this.singlePizzaAngle / 2)) * Math.PI / 180);
  11. this.ctx.fillText(text, isMobile ? 30 : 50, 0);
  12. this.ctx.restore();
  13. }
Add Comment
Please, Sign In to add comment