Advertisement
Alyks

Untitled

May 25th, 2020
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.10 KB | None | 0 0
  1. for (int x = 0; x <= width; x += width / ROW_COUNT) {
  2.             if (draw && x != width) // Если draw = true и x не дошло до значения width, то рисуем букву
  3.                 drawLetter(x + offsetLeft, offsetTop, x / (width / ROW_COUNT), fontSize, width / ROW_COUNT, root);
  4.             context.moveTo(x, 0);
  5.             context.lineTo(x, height); // Рисуем линию сетки для оси x
  6.         }
  7.  
  8.         for (int y = 0; y <= height; y += height / COL_COUNT) {
  9.             if (draw && y != height) // Если draw = true и x не дошло до значения width, то рисуем цифру
  10.                 drawDigit(offsetLeft, y + offsetTop, y / (height / COL_COUNT), fontSize, height / COL_COUNT, root);
  11.             context.moveTo(0, y);
  12.             context.lineTo(width, y); // Рисуем линию сетки для оси y
  13.         }
  14.  
  15.         context.setStroke(Color.BLACK); // Цвет линий - черный
  16.         context.setLineWidth(1); // Ширина - 1
  17.         context.stroke(); // Обводим линии черным цветом
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement