From 032fc35275760df1cb8e45282e5f9b5f9ed096c4 Mon Sep 17 00:00:00 2001 From: Benoit KUGLER Date: Thu, 24 Oct 2024 15:03:45 +0200 Subject: [PATCH] rename method --- pdf/page.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pdf/page.go b/pdf/page.go index 8413dde..7fdb605 100644 --- a/pdf/page.go +++ b/pdf/page.go @@ -30,7 +30,7 @@ func (g *group) SetColorPattern(p backend.Canvas, contentWidth, contentHeight fl mat = mat.Multiply(g.app.State.Matrix) // initiate the pattern ... - _, _, gridWidth, gridHeight := p.GetRectangle() + _, _, gridWidth, gridHeight := p.GetBoundingBox() pattern := &model.PatternTiling{ XStep: gridWidth, YStep: gridHeight, Matrix: mat, @@ -224,11 +224,20 @@ func (cp *outputPage) SetBleedBox(left fl, top fl, right fl, bottom fl) { // graphic operations // Returns the current page rectangle -func (g *group) GetRectangle() (left fl, top fl, right fl, bottom fl) { +func (g *group) GetBoundingBox() (left, top, right, bottom fl) { bbox := g.app.BoundingBox return bbox.Llx, bbox.Lly, bbox.Urx, bbox.Ury } +// Updates the current page rectangle +func (g *group) SetBoundingBox(left, top, right, bottom fl) { + bbox := &g.app.BoundingBox + bbox.Llx = left + bbox.Lly = top + bbox.Urx = right + bbox.Ury = bottom +} + // OnNewStack save the current graphic stack, // execute the given closure, and restore the stack. // If an error is encoutered, the stack is still restored