Skip to content

Commit

Permalink
arc: Make update position optional
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-wolf committed Dec 3, 2023
1 parent 74e2a3f commit 1792a02
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Binary file modified manual.pdf
Binary file not shown.
5 changes: 4 additions & 1 deletion src/draw/shapes.typ
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@
/// == Keys
/// #show-parameter-block("radius", ("number", "array"), [The radius of the arc. An elliptical arc can be created by passing a tuple of numbers where the first element is the x radius and the second element is the y radius.], default: 1)
/// #show-parameter-block("mode", ("string",), [The options are: "OPEN" no additional lines are drawn so just the arc is shown; "CLOSE" a line is drawn from the start to the end of the arc creating a circular segment; "PIE" lines are drawn from the start and end of the arc to the origin creating a circular sector.], default: "OPEN")
/// #show-parameter-block("update-position", ("bool",), [Update the current canvas position to the arc's end point (anchor `"arc-end"`)], default: true)
///
/// = Anchors
/// Supports compass anchors when `mode` is "PIE"
Expand Down Expand Up @@ -312,7 +313,9 @@
)

// Set the last position to arc-end
ctx.prev.pt = arc-end
if style.update-position {
ctx.prev.pt = arc-end
}

// Center is calculated based on observations of tikz's circular sector and semi circle shapes.
let center = if style.mode != "CLOSE" {
Expand Down
1 change: 1 addition & 0 deletions src/styles.typ
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
// - "PIE"
mode: "OPEN",
mark: _default-mark,
update-position: true,
),
content: (
// Allowed values:
Expand Down

0 comments on commit 1792a02

Please sign in to comment.