Skip to content

Commit

Permalink
Merge pull request #115 from twpayne/clip-by-bounds
Browse files Browse the repository at this point in the history
Add Geom.ClipByBounds
  • Loading branch information
twpayne authored Jan 15, 2024
2 parents ba7784a + 76e2fb2 commit acfb301
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions geom.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func (g *Geom) MakeValidWithParams(method MakeValidMethod, collapse MakeValidCol
return g.context.newGeom(cRes, nil)
}

func (g *Geom) ClipByBounds(bounds *Bounds) *Geom {
return g.ClipByRect(bounds.MinX, bounds.MinY, bounds.MaxX, bounds.MaxY)
}

// CoordSeq returns g's coordinate sequence.
func (g *Geom) CoordSeq() *CoordSeq {
g.mustNotBeDestroyed()
Expand Down

0 comments on commit acfb301

Please sign in to comment.