MCPcopy Create free account
hub / github.com/angular/components / _invertPosition

Method _invertPosition

src/material/tooltip/tooltip.ts:727–743  ·  view source on GitHub ↗

Inverts an overlay position.

(x: HorizontalConnectionPos, y: VerticalConnectionPos)

Source from the content-addressed store, hash-verified

725
726 /** Inverts an overlay position. */
727 private _invertPosition(x: HorizontalConnectionPos, y: VerticalConnectionPos) {
728 if (this.position === 'above' || this.position === 'below') {
729 if (y === 'top') {
730 y = 'bottom';
731 } else if (y === 'bottom') {
732 y = 'top';
733 }
734 } else {
735 if (x === 'end') {
736 x = 'start';
737 } else if (x === 'start') {
738 x = 'end';
739 }
740 }
741
742 return {x, y};
743 }
744
745 /** Updates the class on the overlay panel based on the current position of the tooltip. */
746 private _updateCurrentPositionClass(connectionPair: ConnectionPositionPair): void {

Callers 2

_getOriginMethod · 0.95
_getOverlayPositionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected