Instance Method

widgetOriginForWidgetSize:withPreferredOrigin:

Get a valid origin on page from a preferred origin.


Declaration


-(HSWidgetPosition)widgetOriginForWidgetSize:(HSWidgetSize)size withPreferredOrigin:(HSWidgetPosition)position;

Parameters

Return Value

A valid widget position on the page for the given size; otherwise an invalid location of (0, 0). The following procedure is used to determine a valid widget position:

  1. If frame of the preferred position and size is valid then return preferred position.
  2. Try shifting position until a valid frame can be created. If a valid frame can be created, return that position.
  3. Otherwise return an invalid position of (0, 0).