docs: private void resize() {
          width                        = getWidth() - getInsets().getLeft() - getInsets().getRight();
          height                       = getHeight() - getInsets().getTop() - getInsets().getBottom();
          pixelSize                    = (width / cols) < (height / rows) ? (width / cols) : (height / rows);
          pixelWidth                   = (width / cols);
          pixelHeight                  = (height / rows);
          spacer                       = useSpacer ? pixelSize * getSpacerSizeFactor() : 0;
          pixelSizeMinusDoubleSpacer   = pixelSize - spacer * 2;
          pixelWidthMinusDoubleSpacer  = pixelWidth - spacer * 2;
          pixelHeightMinusDoubleSpacer = pixelHeight - spacer * 2;
  
  
          if (width > 0 && height > 0) {
              if (squarePixels) {
                  pixelWidth                   = pixelSize;
                  pixelHeight                  = pixelSize;
                  pixelWidthMinusDoubleSpacer  = pixelSizeMinusDoubleSpacer;
                  pixelHeightMinusDoubleSpacer = pixelSizeMinusDoubleSpacer;
              }
              canvas.setWidth(cols * pixelWidth);
              canvas.setHeight(rows * pixelHeight);
  
              canvas.relocate((getWidth() - (cols *pixelWidth)) * 0.5, (getHeight() - (rows * pixelHeight)) * 0.5);
  
              drawMatrix();
          }
      }