Skip to content

Commit f8ad7e2

Browse files
committed
Remove accidental double-BT in right-alignment mode
1 parent 5237ee3 commit f8ad7e2

2 files changed

Lines changed: 1 addition & 8 deletions

File tree

lib/mudbrick/text_block/output.ex

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,16 @@ defmodule Mudbrick.TextBlock.Output do
116116
%Mudbrick.TextBlock{
117117
align: :right,
118118
font: font,
119-
font_size: font_size,
120-
position: {x, y}
119+
font_size: font_size
121120
} = tb
122121
) do
123122
output =
124123
%__MODULE__{font: font, font_size: font_size}
125124
|> RightAlign.reduce_lines(tb.lines, fn output, text, line ->
126125
right_offset(output, tb, text, line)
127126
end)
128-
|> add(%Td{tx: x, ty: y})
129127
|> add(%TL{leading: leading(tb)})
130128
|> add(%Tf{font: font, size: font_size})
131-
|> start_block()
132129

133130
output.operations
134131
end

test/mudbrick/text_block_test.exs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,8 @@ defmodule Mudbrick.TextBlockTest do
154154
describe "right-aligned" do
155155
test "newlines become Tjs with offsets" do
156156
assert [
157-
"BT",
158157
"/F1 10 Tf",
159158
"12.0 TL",
160-
"400 500 Td",
161159
"BT",
162160
"384.82 500.0 Td",
163161
"0 0 0 rg",
@@ -222,10 +220,8 @@ defmodule Mudbrick.TextBlockTest do
222220

223221
test "inline font change is written with Tfs" do
224222
assert [
225-
"BT",
226223
"/F1 10 Tf",
227224
"12.0 TL",
228-
"400 500 Td",
229225
"BT",
230226
"225.89999999999998 500.0 Td",
231227
"0 0 0 rg",

0 commit comments

Comments
 (0)