code: function(position, size) {
              var properties = $.Placement.properties[this.placement];
              if (!properties) {
                  return;
              }
              if (properties.isHorizontallyCentered) {
                  position.x -= size.x / 2;
              } else if (properties.isRight) {
                  position.x -= size.x;
              }
              if (properties.isVerticallyCentered) {
                  position.y -= size.y / 2;
              } else if (properties.isBottom) {
                  position.y -= size.y;
              }
          }
docs: Internal function to adjust the position of an overlay
  depending on it size and placement.
  @function
  @param {OpenSeadragon.Point} position
  @param {OpenSeadragon.Point} size