public static < T extends IPositioned & ISized > IntSupplier centeredTo ( ISized owner , T other , int offset ) { checkNotNull ( other ) ; return ( ) -> { return other . position ( ) . x ( ) + ( other . size ( ) . width ( ) - owner . size ( ) . width ( ) ) / 2 + offset ; } ; }
Centers the owner to the other .