Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions src/Graphics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Graphics defines an API for drawing in two dimensions.

- Clipping: `clip`, `clip_preserve`, `reset_clip`, `inner_canvas`

- Paths: `move_to`, `line_to`, `rel_line_to`, `rel_move_to`,
- Paths: `move_to`, `line_to`, `curve_to`, `rel_curve_to`, `rel_line_to`, `rel_move_to`,
`new_path`, `new_sub_path`, `close_path`, `arc`

- High-level paths: `rectangle`, `circle`, `polygon`
Expand Down Expand Up @@ -71,7 +71,7 @@ export
clip, clip_preserve, reset_clip, inner_canvas,

# path primitives
move_to, line_to, rel_line_to, rel_move_to, new_path, new_sub_path,
move_to, line_to, curve_to, rel_curve_to, rel_line_to, rel_move_to, new_path, new_sub_path,
close_path, arc,

# fill and stroke
Expand Down Expand Up @@ -722,6 +722,24 @@ See also: [`rel_line_to`](@ref).
"""
@mustimplement line_to(gc::GraphicsContext, ::Real, ::Real)

"""
curve_to(gc::GraphicsContext, c1x, c1y, c2x, c2y, x, y)

Add a cubic bezier curve to the path. The control points will be the current point, `(c1x, c1y)`, `(c2x, c2y)` and `(x, y)`. The current point will be moved to `(x, y)`.

See also: [`rel_curve_to`](@ref).
"""
@mustimplement curve_to(gc::GraphicsContext, ::Real, ::Real, ::Real, ::Real, ::Real, ::Real)

"""
rel_curve_to(gc::GraphicsContex, Δc1x, Δc1y, Δc2x, Δc2y, Δx, Δy)

Add a cubic bezier curve to the path. The control points will be the current point `(x, y)` and `(x, y) + [(Δc1x, Δc1y), (Δc2x, Δc2y), (Δx, Δy)]`. The current point will be moved to `(x + Δx, y + Δy)`.

See also: [`curve_to`](@ref).
"""
@mustimplement rel_curve_to(gc::GraphicsContext, ::Real, ::Real, ::Real, ::Real, ::Real, ::Real)

"""
rel_move_to(gc::GraphicsContext, Δx, Δy)

Expand Down
Loading