flipHorizontallyAroundCenter method

void flipHorizontallyAroundCenter()
inherited

Flip the component horizontally around its center line.

Implementation

void flipHorizontallyAroundCenter() {
  if (_anchor.x != 0.5) {
    final delta = (1 - 2 * _anchor.x) * width * transform.scale.x;
    transform.x += delta * math.cos(transform.angle);
    transform.y += delta * math.sin(transform.angle);
  }
  transform.flipHorizontally();
}