diff --git a/buffer.go b/buffer.go index 858d97f..79ed49a 100644 --- a/buffer.go +++ b/buffer.go @@ -69,6 +69,12 @@ func (b *Buffer[T]) Height() int { return b.height } +// Offset returns the offset of b relative to its parent buffer. +// Offset returns zeros if b has no parent +func (b *Buffer[T]) Offset() (x, y int) { + return b.x, b.y +} + // OffsetX returns the horizontal offset of b relative to its parent buffer. // OffsetX returns 0 if b has no parent func (b *Buffer[T]) OffsetX() int {