Skip to content

Commit cd8d6a2

Browse files
authored
add docstring for get_enclosing_bounding_box (#65)
1 parent 8e21d77 commit cd8d6a2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/layout.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,25 @@ function get_alignment_offset(total_height::I, total_width::I, alignment, paddin
228228
end
229229
end
230230

231+
"""
232+
get_enclosing_bounding_box(shapes...)
233+
234+
Return a bounding box (preferably the smallest one) that encloses all the shapes in `shapes`.
235+
236+
# Examples
237+
```julia-repl
238+
julia> import SimpleDraw
239+
240+
julia> shape1 = SimpleDraw.Rectangle(SimpleDraw.Point(2, 3), 4, 5)
241+
SimpleDraw.Rectangle{Int64}(SimpleDraw.Point{Int64}(2, 3), 4, 5)
242+
243+
julia> shape2 = SimpleDraw.Rectangle(SimpleDraw.Point(4, 5), 6, 7)
244+
SimpleDraw.Rectangle{Int64}(SimpleDraw.Point{Int64}(4, 5), 6, 7)
245+
246+
julia> SimpleIMGUI.get_enclosing_bounding_box(shape1, shape2)
247+
SimpleDraw.Rectangle{Int64}(SimpleDraw.Point{Int64}(2, 3), 8, 9)
248+
```
249+
"""
231250
function get_enclosing_bounding_box(shapes...)
232251
shape1 = shapes[1]
233252
i_min = SD.get_i_min(shape1)

0 commit comments

Comments
 (0)