SGraphyRectItem.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * ********************************************************************************************************************
  3. *
  4. * iFHS7.
  5. * ;BBMBMBMc rZMBMBR BMB
  6. * MBEr:;PBM, 7MBMMEOBB: BBB RBW
  7. * XK: BO SB. :SZ MBM. c;; ir BBM :FFr :SSF: ;xBMB:r iuGXv. i:. iF2;
  8. * DBBM0r. :D S7 ;XMBMB GMBMu. MBM: BMB MBMBBBMBMS WMBMBMBBK MBMBMBM BMBRBMBW .MBMBMBMBB
  9. * :JMRMMD .. , 1MMRM1; ;MBMBBR: MBM ;MB: BMB: MBM. RMBr sBMH BM0 UMB, BMB. KMBv
  10. * ;. XOW B1; :uM: 1RE, i .2BMBs rMB. MBO MBO JMB; MBB MBM BBS 7MBMBOBM: MBW :BMc
  11. * OBRJ.SEE MRDOWOR, 3DE:7OBM . ;BMB RMR7BM BMB MBB. BMB ,BMR .BBZ MMB rMB, BMM rMB7
  12. * :FBRO0D0 RKXSXPR. JOKOOMPi BMBSSWBMB; BMBB: MBMB0ZMBMS .BMBOXRBMB MBMDE RBM2;SMBM; MBB xBM2
  13. * iZGE O0SHSPO. uGZ7. sBMBMBDL :BMO OZu:BMBK, rRBMB0; ,EBMB xBMBr:ER. RDU :OO;
  14. * ,BZ, 1D0 RPSFHXR. xWZ .SMr . .BBB
  15. * :0BMRDG RESSSKR. 2WOMBW; BMBMR
  16. * i0BM: SWKHKGO MBDv
  17. * .UB OOGDM. MK, Copyright (c) 2015-2018. 斯伯坦机器人世界
  18. * , XMW ..
  19. * r All rights reserved.
  20. *
  21. * ********************************************************************************************************************
  22. */
  23. import SGraphyItem from '../SGraphyItem'
  24. import SRect from '../types/SRect'
  25. /**
  26. * SGraphy引擎时钟Item
  27. *
  28. * @author Andy
  29. */
  30. export default class SGraphyRectItem extends SGraphyItem {
  31. /**
  32. * 构造函数
  33. */
  34. constructor(width, height, parent) {
  35. super(parent)
  36. this.name = 'RectItem'
  37. this.width = width
  38. this.height = height
  39. this.style = '#f00'
  40. this.canMove = true
  41. } // Function constructor()
  42. /**
  43. * Item对象边界区域
  44. *
  45. * @return SRect
  46. */
  47. boundingRect() {
  48. return new SRect(0, 0, this.width, this.height)
  49. } // Function boundingRect()
  50. /**
  51. * 绘制时钟
  52. *
  53. * @param canvas 画布
  54. * @param rect 绘制区域
  55. */
  56. onDraw(canvas, rect) {
  57. canvas.fillStyle = this.style
  58. canvas.fillRect(0, 0, this.width, this.height)
  59. } // Function onDraw()
  60. } // Class SGraphyRectItem