From d036639ee6e1f34c8e9e72a141ba0b9c0675f367 Mon Sep 17 00:00:00 2001 From: Timon Ringwald Date: Wed, 4 May 2022 18:06:24 +0200 Subject: [PATCH] Offset introduced --- buffer.go | 6 ++++++ 1 file changed, 6 insertions(+) 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 {