Skip to content

Commit 9ea462e

Browse files
committed
Lines have widths, not line widths.
1 parent 56e28a1 commit 9ea462e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

lib/mudbrick.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ defmodule Mudbrick do
2626
...> |> move(to: {55, 40}) # starting near the middle of the page
2727
...> |> line(
2828
...> to: {95, 5}, # ending near the bottom right
29-
...> line_width: 6.0, # make it fat
29+
...> width: 6.0, # make it fat
3030
...> colour: {1, 0, 0} # make it red
3131
...> )
3232
...> end)
@@ -280,7 +280,7 @@ defmodule Mudbrick do
280280
...> import Mudbrick.Path
281281
...> path
282282
...> |> move(to: {0, 0})
283-
...> |> line(to: {50, 50}, colour: {1, 0, 0}, line_width: 9)
283+
...> |> line(to: {50, 50}, colour: {1, 0, 0}, width: 9)
284284
...> |> rectangle(lower_left: {0, 0}, dimensions: {50, 60})
285285
...> end)
286286
...> |> render()

lib/mudbrick/path.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ defmodule Mudbrick.Path do
5050
defmodule Line do
5151
@type option ::
5252
{:to, Mudbrick.coords()}
53-
| {:line_width, number()}
53+
| {:width, number()}
5454
| {:colour, Mudbrick.colour()}
5555

5656
@type options :: [option()]
5757

5858
@type t :: %__MODULE__{
5959
to: Mudbrick.coords(),
60-
line_width: number(),
60+
width: number(),
6161
colour: Mudbrick.colour()
6262
}
6363

6464
@enforce_keys [:to]
6565
defstruct to: nil,
66-
line_width: 1,
66+
width: 1,
6767
colour: {0, 0, 0}
6868

6969
@doc false

lib/mudbrick/path/output.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ defmodule Mudbrick.Path.Output do
3434

3535
acc
3636
|> add(Rg.new(stroking: true, r: r, g: g, b: b))
37-
|> add(%W{width: line.line_width})
37+
|> add(%W{width: line.width})
3838
|> add(%L{coords: line.to})
3939
|> add(%S{})
4040

test/drawing_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ defmodule Mudbrick.DrawingTest do
7070
|> line(to: {50, 50})
7171

7272
assert path.sub_paths == [
73-
Line.new(to: {50, 50}, line_width: 1),
73+
Line.new(to: {50, 50}, width: 1),
7474
Move.new(to: {50, 50})
7575
]
7676
end
@@ -135,7 +135,7 @@ defmodule Mudbrick.DrawingTest do
135135
operations(fn ->
136136
new()
137137
|> move(to: {0, 650})
138-
|> line(to: {460, 750}, line_width: 4.0)
138+
|> line(to: {460, 750}, width: 4.0)
139139
end)
140140
end
141141

0 commit comments

Comments
 (0)