not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
955 B

  1. /* Size button will change the size of the drawings for pencil and eraser */
  2. define([], function() {
  3. /* onClick change size and icon */
  4. function onSizeClick() {
  5. var sizeSVG = '1';
  6. var size = PaintApp.data.size;
  7. switch (size) {
  8. case 5:
  9. size = 10;
  10. sizeSVG = '2';
  11. break;
  12. case 10:
  13. size = 15;
  14. sizeSVG = '3';
  15. break;
  16. case 15:
  17. size = 20;
  18. sizeSVG = '4';
  19. break;
  20. case 20:
  21. size = 5;
  22. sizeSVG = '1';
  23. break;
  24. }
  25. PaintApp.data.size = size;
  26. PaintApp.elements.sizeButton.style.backgroundImage = 'url(icons/size-' + sizeSVG + '.svg)';
  27. }
  28. function initGui() {
  29. var sizeButtonElement = document.getElementById('size-button');
  30. PaintApp.elements.sizeButton = sizeButtonElement;
  31. sizeButtonElement.addEventListener('click', onSizeClick);
  32. }
  33. var sizeButton = {
  34. initGui: initGui
  35. };
  36. return sizeButton;
  37. });