centerCursor(processor) {
    const img = this.getImage(processor);
    const cursor = this.getCursor(processor);
    let size = 0;
    const imgrect = img.getBoundingClientRect();
    if (imgrect.width > imgrect.height) {
      size = imgrect.height;
      cursor.style.left = (imgrect.width - size) / 2 + 'px';
      cursor.style.top = 0 + 'px';
    } else {
      size = imgrect.width;
      cursor.style.left = 0 + 'px';
      cursor.style.top = (imgrect.height - size) / 2 + 'px';
    }
    cursor.style.width = size + 'px';
    cursor.style.height = size + 'px';
  }
Automatically center a cursor taking full images's smallest side length