setLeftTop method

void setLeftTop(
  1. Point<num> position
)

Sets the CSS left/top values of avatar. Takes care of any left/top margins the avatar might have to correctly position the element.

Note: The avatar must already be in the DOM for the margins to be calculated correctly.

Implementation

void setLeftTop(Point position) {
  if (avatar != null) {
    avatar!.style.left = '${position.x - (marginLeft ?? 0)}px';
    avatar!.style.top = '${position.y - (marginTop ?? 0)}px';
  }
}